Thanks to all...
>Some useful perl control structures:
>
>do { statements; } while someexpression;
>do { statements; } until someexpression;
>while (someexpression) { statements; } --or-- statement while
>someexpression;
>until (someexpression) { statements; } --or-- statement until
>someexpressi
gt;
of course, you could do:
open(INFILE,"myfile.txt");
for ()
{
# do something with $_
}
but, that isn't going to help understanding :)
> -Original Message-----
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 12:25 PM
> To: [EMAIL PR
Good catch. That's what I meant, alright.
-Original Message-
From: bob ackerman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 2:34 PM
To: Timothy Johnson
Cc: [EMAIL PROTECTED]
Subject: Re: while and do
On Thursday, April 11, 2002, at 01:17 PM, Timothy Johnson
FILE,"myfile.txt");
for ()
{
# do something with $_
}
but, that isn't going to help understanding :)
> -Original Message-----
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: whi
e. I learned this lesson the
hard way.
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: Re: while and do
On Thursday, April 11, 2002, at 12:02 , Teresa Raymond wrote:
> Could someone explain the while
Teresa Raymond wrote:
>
> Could someone explain the while and do w/ couple of examples? I have
> yet to use them, only using the foreach loop and if else stmts.
Have you read the perlsyn document?
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
On Thursday, April 11, 2002, at 12:02 , Teresa Raymond wrote:
> Could someone explain the while and do w/ couple of examples? I have yet
> to use them, only using the foreach loop and if else stmts.
the obvious ones are
while() {
# bunch of stuff one wants to do with
while ($file = shift @build_line or $dir = shift @makedir){ # will do
@build_line first then @makedir
} # can't do that with foreach
do{ # do this loop at least once regardless of the conditional at the
end
print "This time ", $n++," attempts.\n";
} until ($n >= 1);