Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: List assignment in scalar context

by !1 (Hermit)
on Jan 10, 2005 at 19:32 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-08-05 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?