$foo = "\tfoo"; $_ = ">>ha<<\n"; s/ha/$foo/; print; $_ = ">>ha<<\n"; s/ha/\Q$foo\E/; print; quotemeta $foo; # update: this is doing nothing! $_ = ">>ha<<\n"; s/ha/$foo/; print; $foo = '\tfoo'; $_ = ">>ha<<\n"; s/ha/$foo/; print; $_ = ">>ha<<\n"; s/ha/\Q$foo\E/; print; quotemeta $foo; # update: this is doing nothing! $_ = ">>ha<<\n"; s/ha/$foo/; print; #### >> foo<< >>\ foo<< >> foo<< >>\tfoo<< >>\\tfoo<< >>\tfoo<<