in reply to How do I take a slice of a hash reference?
Note that we do not need parenths for the array at all.
my $arr = [1,'a',2,'b']; my $hash = {1,'a',2,'b'}; print join ':', @$arr[1,2]; print join ':',(@$hash{1,2});
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I take a slice of a hash reference?
by tachyon (Chancellor) on May 21, 2001 at 10:00 UTC |