Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Auto Increment "magic" Inquiry

by chargrill (Parson)
on Jan 05, 2007 at 23:27 UTC ( #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
Node Status?
node history
Node Type: note [id://593223]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-09-15 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (180 votes). Check out past polls.

    Notices?