$reg = qr'foo'; $str = 'foo'; $str2 = '(?-xism:foo)'; $reg_ref = \$reg; $str_ref = \$str; $str2_ref = \$str2; print "$reg -> $reg_ref\n"; print "$str -> $str_ref\n"; print "$str2 -> $str2_ref\n";