Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is what I think the output would look like (I don't have access to a programming environment at the moment; otherwise, I'd just type stuff in and see what happens):$rec = { TEXT => "Fred loves Ethel", SEQUENCE => [ 13, 27, 47, 98 ], LOOKUP => { cars => 'Buick', dog = 'hound' }, THATCODE => \&some_function, THISCODE => sub { $_[0] ** $_[1] }, HANDLE => \*STDOUT, }; print $rec->{TEXT}; print $rec->{SEQUENCE}[0]; print $rec->{LOOKUP}{"dog"};
Fred loves Ethel 13 hound
Am I correct about the output of these print statements?
Thank you for your help as I read through these tutorials to learn Perl.
Raye Ann Whitlow
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Learning about Arrays and Hashes - printing pieces of them
by Your Mother (Archbishop) on Jan 28, 2015 at 19:29 UTC | |
by Anonymous Monk on Jan 28, 2015 at 19:56 UTC | |
by NetWallah (Canon) on Jan 28, 2015 at 20:10 UTC |