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.
In reply to Re: Regex to end of a line from previous line
by moritz
in thread Regex to end of a line from previous line
by bp4a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |