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.
|
|---|