in reply to Re: Re: Hash slices ?
in thread Hash slices ?
See the "same as"? That's the operative words. To make it the same, it has to return the last element of the list in a scalar context. So yes, the behavior is documented, and derivable from the docs.@days # ($days[0], $days[1],... $days[n]) @days[3,4,5] # same as @days[3..5] @days{'a','c'} # same as ($days{'a'},$days{'c'})
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: Hash slices ?
by tye (Sage) on Dec 02, 2000 at 06:48 UTC | |
by tilly (Archbishop) on Apr 13, 2001 at 18:43 UTC | |
by tye (Sage) on Apr 13, 2001 at 18:50 UTC | |
by tilly (Archbishop) on Apr 13, 2001 at 19:18 UTC | |
by tye (Sage) on Apr 13, 2001 at 20:23 UTC | |
| |
Re: Re: Re: Re: Hash slices ?
by snax (Hermit) on Dec 01, 2000 at 21:24 UTC | |
Re:(4) Hash slices? (Good source for list vs. array issues?)
by Russ (Deacon) on Dec 01, 2000 at 21:41 UTC |