in reply to Re^4: Stupid question about strings...
in thread Stupid question about strings...

Thank you both, AnomalousMonk and Laurent_R.

You've made clear something that previous (careless?) readings of the docs left me in a blindspot in which I conflated 'quotemeta' (as a generic descriptor) with q, qq, qr.... instead of understanding that quotemeta() IS an operator in its own right.

So, FTR, both versions of this code produce identical output:

C:\> perl -E "my $str = qq(|g|h|i); my $strQ = qq(\Q|g|h|i\E); say quo +temeta($str); say $strQ;" \|g\|h\|i \|g\|h\|i

P.S. Technically, this reply is directed to /me, but is done deliberately to acknowledge both previous replies and their authors.


Note to self: RTFM -- more carefully!

Replies are listed 'Best First'.
Re^6: Stupid question about strings...
by Laurent_R (Canon) on Jul 15, 2014 at 17:42 UTC
    I guess you mixed up the "quote and quote-like" operators (q, qq, qr, qw...) with the "quotemeta" operator. There has been a point of time in the past where the distinction wasn't that clear to me either.