Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 meditating upon the Monastery: (15)
As of 2015-07-01 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls