I think you're looking for last:
florg#!/usr/bin/perl -w use strict; while (<DATA>) { next unless /trigger/; while (<DATA>) { if ( $_ =~ /timestamp/ ) { print "Found timestamp\n"; last; } } } __DATA__ bar baz trigger qux timestamp quux quuux trigger quuuux timestamp bar
In reply to Re: Exiting a loop trickery
by florg
in thread Exiting a loop trickery
by GaijinPunch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |