$qr_a = qr/\w/; # Pre-compiled during BEGIN {} $qr_b = qr/\d/; # Pre-compiled during BEGIN {} # Stringify both $qr_a and $qr_b then compile new regex. The previous pre-compilation is not used $data =~ m/$qr_a$qr_b/; # match() # regcomp() # Compile the expression # regcreset $re_a = "\\w"; $re_b = "\\d"; $data =~ m/$re_a$re_b/; # match() # regcomp() # Compile the expression # regcreset