Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: while loop question

by aaron_baugher (Curate)
on Sep 06, 2012 at 15:40 UTC ( #992120=note: print w/replies, xml ) Need Help??


in reply to while loop question

I know we're supposed to hate goto and never ever ever use it, but it does make for a very clear solution in this case:

#!/usr/bin/env perl use Modern::Perl; while(<DATA>){ goto SKIPPED if /match/; } say 'Do something after normal loop exit'; SKIPPED: say 'Proceeding with rest of program'; __DATA__ line 1 line 2 match line 3 line 4

Aaron B.
Available for small or large Perl jobs; see my home node.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992120]
help
Chatterbox?
[choroba]: I don't see it when XP doesn't change either
[marinersk]: That has always been its behavior, but I'm a visual/spacial- awareness guy. When the node disappears, it messes with my head, even though it is on the right margin.
[marinersk]: I was hoping there was a way to turn it on and make it stay on.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2017-05-29 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?