pl@nereida:~/src/perl/perltesting$ cat ./timeregexpwithp.pl #!/usr/local/lib/perl/5.10.1/bin//perl5.10.1 -w use strict; use Benchmark qw{:all}; cmpthese( 1000000, { p => q{'hola juan' =~ /ju/p; my ($a, $b, $c) = (${^PREMATCH}, ${^MATCH}, ${^POSTMATCH} ) }, oldway => q{'hola juan' =~ /ju/; my ($a, $b, $c) = ($`, $&, $') } } ); cmpthese( 10000000, { pnoassign => q{'hola juan' =~ /ju/p; }, oldwaynoassign => q{'hola juan' =~ /ju/; } } ); #### pl@nereida:~/src/perl/perltesting$ ./timeregexpwithp.pl Rate p oldway p 892857/s -- -6% oldway 952381/s 7% -- Rate oldwaynoassign pnoassign oldwaynoassign 3184713/s -- -1% pnoassign 3225806/s 1% --