I can't believe I didn't find this through searching.
While looping through a file,array,hash etc.. how can I start printing only
after a certain expression matches. in other words how can I skip the lines
in the data until an expression match.
Thanks

--

# want to print lines from apple on down

while ($line = <DATA>) {
        next until $line =~ /^banan/;
        print $line;
}


__DATA__
orange
peach
banana
apple
pear
mango



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to