Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Scalar context of slice

by Xilman (Hermit)
on Oct 09, 2008 at 15:25 UTC ( [id://716235]=note: print w/replies, xml ) Need Help??


in reply to Scalar context of slice

In scalar context, @bar{'a', 'b'} is the last element of the list, '' in your example.

The result of the map in list context is a copy of bar but, when evaluated in scalar context, gives the length of the list it copies.

More on p76 of The Camel Book, 3rd Ed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-20 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found