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

Re^3: Perl 5.10: switch statement demo

by talexb (Canon)
on Dec 20, 2007 at 16:26 UTC ( #658155=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl 5.10: switch statement demo
in thread Perl 5.10: switch statement demo

The modulo construct can also be thought of as 'divisible by' -- so $foo % 3 checks to see if $foo is divisible by 3. Or at least that's the way my brain works.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^4: Perl 5.10: switch statement demo
by ikegami (Pope) on Dec 20, 2007 at 21:27 UTC
    That's backwards. $foo % 3 checks if $foo *isn't* divisible by 3. not $foo % 3 would deceptively check if is divisible by 3.

      OK, OK. :) And in this tiny corner of the universe, I'm pretending that a result of 0 means "Yes! It's divisible!". :)

      Your confusion was not my intention.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://658155]
help
Chatterbox?
[Discipulus]: oh and dont miss my last poetry!
[marioroy]: Hello all. After several attempts, am able to move forward and will soon release a Parallel:: ForkManager compatible MCE::Hobo:: Manager, also MCE::Hobo::Simple, and refactored MCE::Hobo engine supporting multiple instances. Wait works beautifully.
[marioroy]: MCE::Shared has been refined that it allows sharing Tie::File and hash objects containing {fh} key.
[marioroy]: It's taken so long to take Hobo to a new level. Threads-like and Parallel:: ForkManager management capaiblities.
[marioroy]: This will complete the 4 years in the making and likely time to move on to something els.
[marioroy]: s/els/else.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-05-26 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?