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

Re^2: Autoincrement operator precedence difference between C and Perl

by shmem (Chancellor)
on Oct 09, 2007 at 21:49 UTC ( [id://643809]=note: print w/replies, xml ) Need Help??


in reply to Re: Autoincrement operator precedence difference between C and Perl
in thread Autoincrement operator precedence difference between C and Perl

While your observations are most probably correct, it stands as a fact that evaluation order of multiple pre/post-increments in one statement isn't explicitly defined in Perl 5, I guess on purpose. It is an artifact of the implementation of Perl - it is not in the language specs afaik - so you shouldn't rely on it, even if all perl 5 binaries we know of stack execution in the way you describe.

And that is more than saying "while you can use multiple pre/post-increments in a single statement, it is bad practice and should be avoided" - it is saying "it's not defined. Don't".

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
  • Comment on Re^2: Autoincrement operator precedence difference between C and Perl

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found