Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: List assignment in scalar context

by !1 (Hermit)
on Jan 10, 2005 at 19:32 UTC ( [id://421057]=note: print w/replies, xml ) Need Help??


in reply to Re^4: List assignment in scalar context
in thread List assignment in scalar context

= is right associative. Thus you have list = list (rightmost) before you get scalar = list = list. The list in question has 3 elements. Of course in this case, I think the behavior of an array in scalar context has more to do with the overall result than anything else. Note that if you replace the array declaration with any list of the form ($a,$b,...), you still get the count in $n2.

perldoc perldata, look for "List assignment in scalar context". Note that the extra parentheses around the rightmost assignment in the example are superfluous since they don't affect the order of operations.

Also, to those downvoting my nodes in this thread: if the reason that you're downvoting my nodes is due to the lack of technical merit of my posts, feel free to /msg me or reply.

  • Comment on Re^5: List assignment in scalar context

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found