in reply to how to print out a variable name and its value
e.g.
will return something along the lines of...use data::Dumper; sub some_sub { my $args = { first_name => '', surname => '', @_ }; print Dumper $args; } some_sub qw/Edward Lear/;
$VAR1 = { first_name => 'Edward', surname => 'Lear', };
It's what I tend to use ...
Update Thanx to massa who pointed out the obvious error in my example code:
doesn't call the sub with named parameters, had it read:some_sub qw/Edward Lear/;
it would.some_sub first_name => 'Edward', surname => 'Lear';
HTH ,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to print out a variable name and its value
by massa (Hermit) on Jul 30, 2008 at 12:07 UTC |