Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Can you find the name of a variable?

by chromatic (Archbishop)
on Nov 13, 2009 at 19:25 UTC ( #807034=note: print w/ replies, xml ) Need Help??


in reply to Can you find the name of a variable?

Untested, but:

use PadWalker 'var_name'; for my $arg (\($foo, $bar, $baz)) { next if defined $$arg; my $name = var_name(0, $arg); croak "You forgot to define $name!\n"; }


Comment on Re: Can you find the name of a variable?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://807034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-07-12 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (241 votes), past polls