in reply to Re: Guess I don't have \Q and \E figured out yet...
in thread Guess I don't have \Q and \E figured out yet...
which produces:$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;
What am I forgetting here?>> foo<< >>\ foo<< >> foo<< >>\tfoo<< >>\\tfoo<< >>\tfoo<<
Update Aarghhh! How bloody embarrassing! Thanks tye, that's what I get for
minimizing my keystrokes!
Useless use of quotemeta in void context at D:\Perl\tmp\quotemeta.pl line 9.
Useless use of quotemeta in void context at D:\Perl\tmp\quotemeta.pl line 15.
/me smacks himself in the forehead
--
I'd like to be able to assign to an luser
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: \Q and \E vs. quotemeta?
by tye (Sage) on Apr 30, 2001 at 20:52 UTC |