|Do you know where your variables are?|
Re: Re: Re: Re: Hash slices ?by snax (Hermit)
|on Dec 01, 2000 at 21:24 UTC||Need Help??|
First, thanks for your comment.
Now, on to what I originally wrote, which may sound snippy -- it's not meant to be.
Right. Well. That's a bit cryptic, though, no?
Further, 2nd Ed of Programming Perl provides that the first line is "Same as" as well. I'm not here to nitpick about right or wrong, though. Perhaps a line in perldata someplace that says "hash slices are lists" would clear things up.
Honestly, I find this behavior a bit odd. With a list, evaluated in a scalar context so that it returns its last value, you could at least have things going on prior to the last value that are meaningful in determining the last value (much like constructs in C with the comma operator).
By the time you shove stuff into an array, or hash, and then pull out a slice, it makes more sense to me for this to be more "array like" than "list like"; the values before the last one are then in the dreaded void context if this object is then evaluated in a scalar context.
That is definitely enough musing from me about what is, to me, a very dusty little corner of perl.