in reply to Re^4: using bits to print part of a string (Bitops win by an order of magnitude)
in thread using bits to print part of a string
sub { printf 'regex: '; my $mask = shift; my $re = '^' . join('', map $_ ? '(.)' : '.', split '', $mask +) . '$'; return sub { my $fh = shift; my $out; my $count = 0; $out = join( '', m[$re]o ), ++$count while <$fh>; $count; } }, __END__ C:\test>1023727 -OPT=4 regex: Took 274.157906 seconds for 2606 records (9.505471 recs/second)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: using bits to print part of a string (Bitops win by an order of magnitude)
by McA (Priest) on Mar 17, 2013 at 09:57 UTC | |
by BrowserUk (Patriarch) on Mar 17, 2013 at 10:20 UTC | |
by McA (Priest) on Mar 17, 2013 at 16:18 UTC |