in reply to Re: Inexplicably slow regex
in thread Inexplicably slow regex
use Benchmark qw( cmpthese ); our $KEY="df"; { local $/; open my $hosts,'/etc/hosts'; $_= <$hosts>; close $hosts; } $_= $_ x (0.5*1024*1024 / length $_); s/$KEY/XX/g; $_.= "\n df "; print length $_,"\n"; cmpthese(-3, { caret => '/^ \s* $KEY /mx', cr => '/\n \s* $KEY /mx', });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inexplicably slow regex
by Anonymous Monk on Sep 13, 2006 at 00:22 UTC | |
by Skeeve (Parson) on Sep 13, 2006 at 06:48 UTC | |
by Anonymous Monk on Sep 13, 2006 at 16:45 UTC |