in reply to Performance of assambled regex

Not an answer to your question, but there is another problem in your code. This line:

open my $fh_big_file, '<', $ARGV[0] || die;

and the following line are buggy for precedence reasons. Use either parentheses:

open( my $fh_big_file, '<', $ARGV[0] ) || die;

or the low precedence or operator;

open my $fh_big_file, '<', $ARGV[0] or die;

Proof:

# There's no file called 'rabbit' in my cwd open my $fh, '<', 'rabbit' || die; print "Still alive!\n"; __END__ Still alive!