Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Dynamic if loop

by CountZero (Bishop)
on Mar 25, 2010 at 07:23 UTC ( #830764=note: print w/replies, xml ) Need Help??

in reply to Dynamic if statement

What have you tried?

What do you mean by an if-loop?

Perl has for or foreach-loops, while and until loops. They can be further modified with next, last, redo and continue operators.

There are a number of hidden loop constructs such as map and grep.

Finally you can "roll your own" with labels, if ... then ... else and goto

Plenty of choice: it is the embarrassment of riches.


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Dynamic if loop
by merlyn (Sage) on Mar 25, 2010 at 16:36 UTC
    Maybe if-loop is the new name for the FOR-CASE paradigm. :)

    -- Randal L. Schwartz, Perl hacker

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830764]
[Your Mother]: Zeitgeist. :P
[LanX]: Talking about Peacemakers, I still need to watch 2 seasons of Farscape ...
[Your Mother]: I liked that show a lot.
[Your Mother]: Packed with minority women.
[LanX]: pitty they burned the actors in Stargate
LanX ... uhm ... wait...
[Eily]: LanX I don't see the woman
[LanX]: at the right, tanned , gib boobs, chains
[LanX]: big

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2018-03-19 14:41 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.