Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi there Monks!
Its a question of doing it better, so I am confused!
How to access or better print the value of "name" from this simple sample code structure:
Its a question of doing it better, so I am confused!
How to access or better print the value of "name" from this simple sample code structure:
Thanks for looking!use strict; use warnings; use Data::Dumper; my $data = [ { 'name' => 'Mary' }, ]; #my $test = $data[0]{1}; #my $test = $ { $data} { name }; #my $test = @{ $data} { name }; my $test = $data->{ name }; print "\n - $test \n"; warn Dumper $test;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Access to hash ref element
by choroba (Cardinal) on May 28, 2013 at 17:33 UTC | |
by Anonymous Monk on May 28, 2013 at 17:46 UTC | |
Re: Access to hash ref element
by Laurent_R (Canon) on May 28, 2013 at 17:40 UTC | |
Re: Access to hash ref element
by TomDLux (Vicar) on May 28, 2013 at 20:01 UTC | |
by davido (Cardinal) on May 28, 2013 at 20:05 UTC | |
by Laurent_R (Canon) on May 28, 2013 at 21:45 UTC | |
by Anonymous Monk on May 28, 2013 at 22:08 UTC | |
by Laurent_R (Canon) on May 28, 2013 at 22:55 UTC | |
Re: Access to hash ref element
by AnomalousMonk (Archbishop) on May 28, 2013 at 19:12 UTC |
Back to
Seekers of Perl Wisdom