how to match a field in a line and print the next line??
david_ross
06-02-2004 02:07 PM
What about something like:
Code:
# Loop through the lines
foreach $line (@lines){
# If the last line matched then print it
if($next eq "print"){
$next="skip";
print $line;
}
# If the line contains "somestring" then keep track in a variable
if($line=~/somestring/){$next="print"}
}