good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Access to hash ref elementby TomDLux (Vicar) |
on May 28, 2013 at 20:01 UTC ( [id://1035713]=note: print w/replies, xml ) | Need Help?? |
Seems to be a popular question for newcomers to ask how to access some component of a complicated structures. The answer is to user the built-in debugger.
When the debugger starts, it shows that it's about to execute line 5. I do a "next" ( 'n') to complete that, and then it's going to execute line 16. I query the debugger to show the value of $data, and then of its components. Since you're looking right at it, it's easy to tell you want array element '0', hash tag 'name'. As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In Section
Seekers of Perl Wisdom
|
|