Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: eval point in hash ref

by LanX (Bishop)
on May 22, 2013 at 10:10 UTC ( #1034712=note: print w/replies, xml ) Need Help??


in reply to eval point in hash ref

to eval commandline arguments is always prone to code injection

you might wanna use a simple recursion:

DB<119> sub dive { my $val=shift; $val = $val->{$_} for @_; return $val; } DB<120> $nethist => { "seek" => { messages => 42 } } DB<121> dive ($nethist) => { "seek" => { messages => 42 } } DB<122> dive ($nethist,"seek","messages") => 42 DB<123> dive ($nethist,"seek") => { messages => 42 }

Cheers Rolf

( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034712]
help
Chatterbox?
[holli]: i am designing an interface. check this out, can you tell immediatly tell me what the code does?
[holli]: scratch one "tell". you decide which ;)
[danaj]: :) Thanks, I should visit more often.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-09-26 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (297 votes). Check out past polls.

    Notices?