Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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.

CountZero

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


Comment on Re: Dynamic if loop
Select or Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-09-23 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls