#!/usr/bin/perl -w
# Next After Match .. PM node 418383
my $filename = shift;
open ( INPUT, $filename ) or
die "Unable to open $filename: $!";
my $string = shift;
my $nextLine;
while() {
if ( /$string/ ) {
$nextLine = ;
last;
}
}
close ( INPUT );
if ( defined ( $nextLine ) ) {
print "INFO: $string found in file $filename, next line is:\n";
print $nextLine;
} else {
print "INFO: $string not found in file $filename.\n";
}