legacy-wiki
Perl
Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.
debugging
[jtanner@rdevimg-dev-01 ~]$ cat perldebug.pl
#!/usr/bin/perl
my $var1 = var1 stuff;
print This is a test \n;
- debug example
[jtanner@rdevimg-dev-01 ~]$ perl -d perldebug.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = en_CA.UTF8,
LC_ALL = (unset),
LANG = en_CA
are supported and installed on your system.
perl: warning: Falling back to the standard locale (C).
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(perldebug.pl:3): my $var1 = var1 stuff;
DB1 l
3== my $var1 = var1 stuff;
4: print This is a test \n;
DB2 s
main::(perldebug.pl:4): print This is a test \n;
DB2 p $var1
var1 stuff
DB1 c
This is a test
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
DB1 p $var1
DB2 s
Use `q' to quit or `R' to restart. `h q' for details.
DB2 R
Warning: some settings and command-line options may be lost!
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
Prepare DEV environment
[root@x200 ~]# yum -y install vim-perl-support vim-X11
[root@x200 ~]# mkdir -p /var/svn/repos/perl
[root@x200 ~]# svnadmin create /var/svn/repos/perl
[root@x200 ~]# chown -R apache.apache /var/svn/repos/perl
[root@x200 ~]# fgrep perl /etc/websvn/config.php
$config-addRepository('perl: generic', 'file:///var/svn/repos/perl');
[root@x200 ~]# chmod -R 777 /var/svn/repos/perl
[root@x200 ~]#
[jtanner@x200 ~]# mkdir -p ~/code; cd ~/code
[jtanner@x200 perl]# svn checkout http://localhost/repos/perl
[jtanner@x200 perl]# gvim perl/helloworld.pl
[jtanner@x200 perl]# svn status
[jtanner@x200 perl]# svn commit -m First Commit
- Committing to dreamhost svn import perl http://svn.tannerjc.net/perl-examples/ -m Initial import
Spacewalk
Timeouts
http://www.linuxquestions.org/questions/linux-server-73/timeout-problem-on-apache-797048/
- If you are using perl’s LWP::UserAgent in the client, you can try changing the timeout parameter: http://kobesearch.cpan.org/htdocs/libwww-perl/LWP/UserAgent.html#ua_gt_timeout
http://stackoverflow.com/questions/73308/true-timeout-on-lwpuseragent-request-method
- deadlock from multiple db transactions
type checking
- perldoc -f ref
DB21 p ref $query_sets-{$qs_name}-{'filter_entries'}-{'filter_entry'}
ARRAY
DB2 p ref $query_sets-{$qs_name}-{'filter_entries'}-{'filter_entry'}
HASH