Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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"; }

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 fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-11-20 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (284 votes). Check out past polls.

    Notices?