Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^7: Why does the first $c evaluate to the incremented value ... (hahaha)

by oiskuu (Friar)
on Mar 05, 2014 at 21:00 UTC ( #1077152=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Why does the first $c evaluate to the incremented value ... (hahaha)
in thread Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?

My "lawyer mode" rant was to show that C is playing catch-up in some areas, and that the rules are anything but clear-cut.

I wouldn't consider perl code that the OP wrote, stupid. In fact I might quite possibly have used the same construct...


Comment on Re^7: Why does the first $c evaluate to the incremented value ... (hahaha)
Re^8: Why does the first $c evaluate to the incremented value ... (stupid)
by tye (Cardinal) on Mar 05, 2014 at 21:45 UTC

    Then you simply need to update your best practices to include "Using a variable in the same statement as you separately modify it is stupid".

    (Then, when it breaks [as it did] you'll save a lot of time by not trying to convince people that it is a bug. :)

    - tye        

Re^8: Why does the first $c evaluate to the incremented value ... (check)
by Anonymous Monk on Mar 06, 2014 at 03:00 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-12-20 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls