Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Auto Increment "magic" Inquiry

by chargrill (Parson)
on Jan 05, 2007 at 23:27 UTC ( [id://593223]=note: print w/replies, xml ) Need Help??


in reply to Re: Auto Increment "magic" Inquiry
in thread Auto Increment "magic" Inquiry

Just for grins, I was trying to see what my local perl would produce. To my surprise, my answer was different! But then I tried a few more things and realized I had misstyped the original problem.

But since I found this interesting, I thought I'd share. (Note, this behavior might also show up in the off-site link from the original poster in my earlier post in this node, but that's old and off-site.)

$ perl -e 'my $m = 20; print $m++ + $m++, "\n"' 41 $ perl -e 'my $m = 20; print $m++ + ++$m, "\n"' 42 $ perl -e 'my $m = 20; print ++$m + $m++, "\n"' 43 $ perl -e 'my $m = 20; print ++$m + ++$m, "\n"' 44


--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found