in reply to string escaping / de-escaping functions

There is also the quotemeta builtin function, which quotes any non-word character with a \. quotemeta will quote the space character but that doesn't seem to affect printing. An esoteric builtin I learned and only ever saw mentioned... here on perlmonks!

Example: perl -e "print quotemeta 'yo, what\'s a "henway"?'" Gives: yo\,\ what\'s\ a\ henway\?

Replies are listed 'Best First'.
Re^2: string escaping / de-escaping functions
by Anonymous Monk on Oct 25, 2008 at 06:35 UTC
    uotemeta will quote the space character but that doesn't seem to affect printing
    What do you mean by that?
      Sorry, you're right. What I meant to say is it doesn't seem to affect matching regular expressions. I'm not sure why I said printing. Then again I should assume quotemeta is safe for regular expressions if it is used by \Q and \E like the docs say! It's late and time for another Pabst!