in reply to Re: How do I take a slice of a hash reference?
in thread How do I take a slice of a hash reference?
Wrong button, especially with a missing </code> Scorn pours forth like a raging torrent....
All that is wrong with your code is the parenths. Join takes a list ie: join '', (list); To give list context to your hash slice all we need to do is move the parenths as shown, this runs fine.
my $arr = 1,'a',2,'b'; my $hash= {1,'a',2,'b'}; print join ':', @$arr1,2; print join ':',(@$hash{1,2});
Note that we do not need parenths for the array at all.
tachyon
|
|---|