in reply to Exiting a loop trickery
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exiting a loop trickery
by Roy Johnson (Monsignor) on Mar 11, 2004 at 15:20 UTC | |
|
Re: Re: Exiting a loop trickery
by GaijinPunch (Pilgrim) on Mar 11, 2004 at 06:36 UTC |