Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re: Re: How's your Perl?

by hessef (Monk)
on Oct 27, 2003 at 15:37 UTC ( #302410=note: print w/replies, xml ) Need Help??

in reply to Re: How's your Perl?
in thread How's your Perl?

I couldn't get :foo while1" to work on my PC (Windows, perl 5.8.0).

I could get to work by rewriting it as "1while foo" or "1until!foo".

My own try involved a for loop--no dice. The best I could do was "for(;;foo){};" which is slightly too long.

Replies are listed 'Best First'.
Re: Re: Re: How's your Perl?
by hardburn (Abbot) on Oct 27, 2003 at 16:43 UTC

    I could get to work by rewriting it as "1while foo" or "1until!foo".

    That loop will stop as soon as foo() returns false. The quiz didn't specify that foo() will always return a true value, so you can't assume it.

    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    :(){ :|:&};:

    Note: All code is untested, unless otherwise stated

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2023-10-03 20:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found