Help for this page
use strict; use warnings; ... my $re = '('+join('|',@ARGV)+')'; $re = qr($re); printf "%d: %s\n", pos($f), $1 while $f =~ /$re/g;
use strict; use warnings; ... while( <$file> ) { printf "%d (%d): %s\n", $., pos, $1 while /$re/g }