in reply to Regular expression

Replies are listed 'Best First'.
Re: Re: Regular expression
by nysus (Parson) on Jun 07, 2001 at 20:28 UTC
    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;

      The 1 does nothing. It is the "body" of the while loop. Basically it is a no-op that won't throw any warnings.
      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.