Dec 30, 2000, 10:28 AM
Post #1 of 3
How do you stop a <While> Loop
How does one stop the while statement looping unnecessarily through all lines in a file after it has found what it was looking for? I do not want to use 'exit;' as I want the remaining script to do other work once it found something.
Thanks for your help.
open(DB, $target) or die "Error opening file: $!\n";
flock DB, $EXCLUSIVE;
($key,@field_vals) = split(/\|/, $_);
if($field_vals =~ /$something/oi )
} # End of while.
flock DB, $UNLOCK;