Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?

by linuxer (Curate)
on Mar 04, 2014 at 23:18 UTC ( [id://1077005]=note: print w/replies, xml ) Need Help??


in reply to Re: Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?
in thread Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?

Looks the same here, with Perl 5.18.1 on Linux:

perl -MData::Dumper -E 'say join ", ", +$c,$c+=1 for 1..3'

1, 1 2, 2 3, 3

perl -MData::Dumper -E 'say join ", ", --$c,$c+=1 for 1..3'

0, 0 0, 0 0, 0

perl -MData::Dumper -E 'say join ", ", - -$c,$c+=1 for 1..3'

0, 1 1, 2 2, 3

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1077005]
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-19 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found