in reply to Common Perl Idioms
I don't know if this is up to the level of some of the other code here, but sometimes, when I want to verify the contents of a few variables (here $var1, @var2, and %var3, for example purposes), I will toss the following into the code:
if (1) { use Data::Dumper; local($| = 1); print Data::Dumper->Dump([\$var1, \@var2, \%var3], [qw(*variable1 *variable2 *variable3)]), "\n"; }
I can then go back and change it to if (0) to turn it off (and leave it there if I expect to need to look at the content of the variables at some point in the future), or remove it entirely once I'm finished.
Don't know if it helps anyone else, but it has proven helpful to me in the past. (And my heartfelt thanks to the monks who led me to using it, after I first started visiting.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Common Perl Idioms
by samtregar (Abbot) on Jul 24, 2004 at 16:41 UTC | |
by greenFox (Vicar) on Jul 26, 2004 at 02:55 UTC | |
Re^2: Common Perl Idioms
by ihb (Deacon) on Jul 24, 2004 at 00:48 UTC |