Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: for loop ?

by DrHyde (Prior)
on Aug 11, 2011 at 10:15 UTC ( #919836=note: print w/replies, xml ) Need Help??


in reply to Re: for loop ?
in thread for loop ?

We did, however, have if ... elsif ... else in the "bad old days", which would be a better approach than abusing a looping construct. Using for like this just makes the code harder to read than it should be.

Replies are listed 'Best First'.
Re^3: for loop ?
by cdarke (Prior) on Aug 12, 2011 at 08:24 UTC
    So far as I know we still have if ... elsif ... else. Personally I would not even think of using a for loop in this way, which means I learnt something. I'm all for trying different code tricks, some are dire and should be destroyed at birth, but some bring enlightenment.
    I'm not sure that the code is any harder to read than some of the attempts at switch/case using LABELS (as in the Perl Cookbook). I agree with your sentiment though, and grateful that we have been blessed with given/when.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://919836]
help
Chatterbox?
[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 lurking in the Monastery: (8)
As of 2017-05-26 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?