Loginskip to content

October 28th, 2006

Suppose we wanted to step through the code

0 ‘Salutations’ 1 ‘Hello’ 2 ‘Hey’ In the first command, we instruct the debugger to print the value of @parole. However, the @paroleassignment has yet to execute, so nothing comes out. Step past the assignment and then print the value with p; we see the current state of the array in a list format. Print the array value with x, and we see the individual elements formatted with array indices (a pretty print). This might look familiar if you’ve been playing with the Data::Dumpermodule we referenced in Chapter 5. In fact, the output of x is intentionally very similar. You can see all of the dynamic variables in a given package (default: main::) with the V command. This isn’t as useful as it sounds because, unlike the xor pcommands, it won’t show you any lexical variables (which you declared with my). Yet you want to make as many of your variables as possible lexical ones (see Perl of Wisdom #8). Unfortunately there is no (easy) way to dump out all the lexical variables in a package, so you’re reduced to printing the ones you know about. A common problem is running off the end of the program and getting the Debuggedprogram terminated message. At that point, all your variables have been destroyed. If you want to inspect the state of variables after the last line of your program has executed, add a dummy line (a 1 by itself will work) so that you can set a breakpoint on it. Tip when examining a hash, examine a reference to it instead. This lets the x command see the datatype you’re inspecting instead of being handed the list that it evaluates to, and it can format it more appealingly: DB<1> %h = (Craig => ‘Stirling’, Sharron => ‘Macready’, Richard => ‘Barrett’); DB<2> x %h 0 ‘Sharron’ ‘Macready’ ‘Craig’ ‘Stirling’ ‘Richard’ ‘Barrett’ DB<3> x %h 0 HASH(0×8330d5c) ‘Craig’ => ‘Stirling’ ‘Richard’ => ‘Barrett’ ‘Sharron’ => ‘Macready’
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

October 28th, 2006

In fact, the debugger for Perl is a

October 28th, 2006

In fact, the debugger for Perl is a

October 28th, 2006

6.5 Acceptance Testing You need a way to

October 28th, 2006

6.5 Acceptance Testing You need a way to

October 27th, 2006

PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/ lib/perl5/5.6.0/i586-linux -I/usr/lib/perl5/5.6.0 -e

October 27th, 2006

PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/ lib/perl5/5.6.0/i586-linux -I/usr/lib/perl5/5.6.0 -e

October 27th, 2006

As if that weren’t enough these Perl people really

October 27th, 2006

As if that weren’t enough these Perl people really

October 27th, 2006

Note by the way that the -e flag