Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl-Sensitive Sunglasses

Re: Re: Re: Re: Hash slices ?

by snax (Friar)
on Dec 01, 2000 at 21:24 UTC ( #44410=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: Re: Hash slices ?
in thread Hash slices ?

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.

Comment on Re: Re: Re: Re: Hash slices ?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://44410]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2014-04-17 10:35 GMT
Find Nodes?
    Voting Booth?

    April first is:

    Results (444 votes), past polls