Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Multiple assignment in Perl

by bart (Canon)
on Jul 24, 2018 at 06:13 UTC ( #1219156=note: print w/replies, xml ) Need Help??


in reply to Multiple assignment in Perl

In Perl, the "," operator has a lower precedence than "=". Therefore, your version means
$a, $b = $b, $a + $b
which does, practically speaking, nothing.

You have to add parens to enforce the proper precedence.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-01-16 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?