my $regex = 'y'; print "ja\n" if "xyz" =~ m/x${regex}z/;