in reply to Regex Start Anchor with variables

An alternative to \Q is quotemeta.
my $re = quotemeta($str2); if( $str1 =~ /^$re/ ) { print "match\n"; } else { print "nomatch\n"; }

index (already shown) is faster.