in reply to print complete line along side line number, when a pattern is matched in log file
$. is the current line number that you can use in your printf?|say statement ...
printf( qq[%04d %s\n], $., $line ); [download]