Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Regular expression

by nysus (Parson)
on Jun 07, 2001 at 20:28 UTC ( [id://86632]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found