enoch has asked for the wisdom of the Perl Monks concerning the following question:
I have tried various iterations trying to get it to reference correctly. And, I have read through perldata and perlref trying to find an answer to this. Does anyone have any insight?my %hash = ( a => 'foo', b => 'bar', c => 'baz', d => 'quux', ); print @hash{'a','d'},"\n"; # correctly prints out "fooquux" my $hashRef = \%hash; # generates error # "Not an ARRAY reference at hashArrayPlay.pl line 16." print @$hashRef->{'a','d'};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pulling Array Out of Hash Reference
by enoch (Chaplain) on Apr 12, 2004 at 22:44 UTC | |
|
Re: Pulling Array Out of Hash Reference
by kvale (Monsignor) on Apr 12, 2004 at 22:43 UTC | |
by antirice (Priest) on Apr 12, 2004 at 23:05 UTC | |
by tye (Sage) on Apr 12, 2004 at 23:24 UTC | |
by antirice (Priest) on Apr 13, 2004 at 00:13 UTC | |
by kvale (Monsignor) on Apr 12, 2004 at 23:22 UTC |