Two questions and code below.
What is the best way to escape a While loop if the desired results is met before the while completes?
The script below is looking for a key phrase "Assign Printers" which it does find and then stops as I had hoped, but it finds the second occurance instead of the first.
# while info come from the IPF handle parse
while ($line = <IPF>)
{
chomp;
$dta = $line;
if ($dta =~ /Assign Printers/i) { # if "Assign Printers" found, end processing
print "Ending, Assing Printers Section Found";
$line = ""; # end while loop
}
}
Thanks for any help!
What is the best way to escape a While loop if the desired results is met before the while completes?
The script below is looking for a key phrase "Assign Printers" which it does find and then stops as I had hoped, but it finds the second occurance instead of the first.
# while info come from the IPF handle parse
while ($line = <IPF>)
{
chomp;
$dta = $line;
if ($dta =~ /Assign Printers/i) { # if "Assign Printers" found, end processing
print "Ending, Assing Printers Section Found";
$line = ""; # end while loop
}
}
Thanks for any help!