in reply to Re: Regular expression
in thread Regular expression

Thanks, but I'm asking what the '1' at the beginning of the line does.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;

Replies are listed 'Best First'.
Re: Re: Re: Regular expression
by Adam (Vicar) on Jun 07, 2001 at 20:31 UTC
    The 1 does nothing. It is the "body" of the while loop. Basically it is a no-op that won't throw any warnings.
Re: Re: Re: Regular expression
by AidanLee (Chaplain) on Jun 07, 2001 at 20:32 UTC
    First off we're using the while loop for it's side effects. I'm guessing that if you're using a while loop idiomatically you need the while loop to do something. the while loop simply returns '1' each time it goes through. I don't know personally if you can have an empty, idiomatic while loop.