use strict; use warnings; use re 'eval'; STDOUT-> autoflush( 1 ); use constant LEN => 10_000; my $n = 0; my $s = '1' x LEN;; my $r = '(1)(?{ # $^N ? 1 : 1; # (*) does use of $^N exacerbate? print "*" and select # to better watch undef, undef, undef, 0.25 # with htop unless ++ $n % 1000 # })' x LEN; print "\nMatch\n" if $s =~ /^$r$/; print "1) Hit Enter"; <>; ( $s = '' ) =~ //; # reset everything # about $s and re-engine (?) $s = ( int rand 10 ) x 1e9; # allocate another Gb print "2) Hit Enter"; <>;