Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Dynamic if loop

by CountZero (Bishop)
on Mar 25, 2010 at 07:23 UTC ( [id://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

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found