if ($test =~m#(??{substr($test, 0, 8)})#) { } #### use strict; use warnings; my $test = "fee fi fo fee"; $_++; if ($test =~ m!((??{ substr($test,0,$_) }))!) { }; #### use strict; use warnings; my $test = "fee fi fo free"; if ($test =~ m!((??{ print "$_\n";substr($test,0,$_) }))!) { }; #### fee fi fo free Argument "fee fi fo free" isn't numeric in substr at (re_eval 1) line 1.