in reply to Regex to end of a line from previous line
while (my $line = <FILE>) { if($line =~ /SQL/) { chomp($date = `date`); chomp ($errcode = $line); print ERR "$date - $errcode\n"; }#end of if }#end of while
P.S. good indenting makes the # end of $something comments superfluous, and increases readability.
|
|---|