Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: odd =>behavior

by tcf03 (Deacon)
on Dec 04, 2007 at 17:29 UTC ( [id://654873]=note: print w/replies, xml ) Need Help??

in reply to Re: odd =>behavior
in thread odd =>behavior

I think I have in fact done that. In my original code, I had fat fingered => ( in lieu of >= ) I had a few moments and was playing with => vs >= on the command line. My first example, using => and >=, outputs 12. So based on that behavior, I would have expected the same to happen in my code.

"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

Replies are listed 'Best First'.
Re^3: odd =>behavior
by Fletch (Bishop) on Dec 04, 2007 at 17:36 UTC

    In your first example you have $num which is greater-than-or-equal to 1, so that prints the 1; you also have (in effect) print 2 if 2 which again is always true so it's always going to print.

    When you change your conditional in the later code to print unless $count => 8 you effectively have print unless 8, which will always be true hence you get all elements.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-05-23 20:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found