Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: Re: Re: Hash slices ?

by snax (Hermit)
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://44410]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-01-17 00:26 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (194 votes). Check out past polls.