in reply to Number of times I've used goto in Perl
Does a named loop count? Something like:
In both cases, your program flow probably needs help. :) (Okay, I'm really bad with configuration files.)TOP_OF_LOOP: while (1) { # do this for (1 .. $some_big_number) { $foo = do_some_function($_); if ($foo % $_ = $some_smaller_number) { next TOP_OF_LOOP; } # do something else } } }
(And, yes, okay, it's an implicit goto. I'm guilty of it once in an AUTOLOAD, though.)
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: Number of times I've used goto in Perl
by turnstep (Parson) on Apr 19, 2000 at 00:42 UTC | |
RE: RE: Number of times I've used goto in Perl
by cciulla (Friar) on Apr 19, 2000 at 02:24 UTC | |
by kaatunut (Scribe) on Dec 12, 2000 at 16:30 UTC |
In Section
Past Polls