Good $localtime honoured monks
I am having a little bother getting a hash slice from an anonymous hash to which I only have a reference. Without further ado some code
#!/usr/bin/perl -l # this works OK my @l=qw(this is); my %e=qw( this 7 is 6 then 9); print $e{is}; print join "+", @e{@l} # output 6 7+6 #!/usr/bin/perl # yet all my attempts to get this working failed # I tried @{$r->{@l}} @{$r->{@l}} and many more I forget my @l=qw(this is); my $r={qw( this 7 is 6 then 9)}; print $r->{is}; print join "+", @{$r->{@l}} # output 6 # just a blank line above.
What arcane combination of line noise like sigils will bring me enlightenment ?
Cheers,
R.
In reply to Hash slice from a hashref by Random_Walk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |