Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Boolean counter?

by Anonymous Monk
on Dec 07, 2009 at 16:15 UTC ( #811533=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Boolean counter?
in thread Boolean counter?

$i appears only once, the behaviour is defined

$ perl -MO=Deparse,-p -le"print - --$i" BEGIN { $/ = "\n"; $\ = "\n"; } print((-(--$i))); -e syntax OK
You were thinking of
print(-( ++$i - --$i ))


Comment on Re^4: Boolean counter?
Select or Download Code
Re^5: Boolean counter?
by ikegami (Pope) on Dec 07, 2009 at 17:01 UTC

    While the operand evaluation order for the ops you've used in your example isn't defined, it doesn't matter (unless there's an overflow) for that example. It's just a clarity issue.

    $i appears only once, the behaviour is defined

    Except it ($Counter) appeared twice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2015-07-04 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls