% perl -MO=Deparse,-p -le '$patt = "a\Ubc"; print qr/$patt/' BEGIN { $/ = "\n"; $\ = "\n"; } ($patt = 'aBC'); print(qr/$patt/); -e syntax OK