$regex = qr/$pattern/; $string =~ /foo${regex}bar/; # interpolate into larger patterns #### my $re = qr!yes|no!; my $re2 = qr!\sthankyou!; my $bigre = $re.$re2; print "polite yes or no\n" if "yes thankyou" =~ $bigre; #### my $bigre = qr!yes|no!.qr!\sthankyou!;
## my $re = qr!yes|no!; my $re2 = qr!\sthankyou!; my $bigre = $re.$re2; print "polite yes or no\n" if "yes thankyou" =~ $bigre; ##
## my $bigre = qr!yes|no!.qr!\sthankyou!;