in reply to Re: quoting for system() and friends
in thread quoting for system() and friends

Forgot to check the requirements? quotemeta is useless here.

$ perl -e '$qs=quotemeta("|"); system( qq{echo "$qs"} );' \|

Replies are listed 'Best First'.
Re^3: quoting for system() and friends
by snoopy (Curate) on Mar 06, 2007 at 11:41 UTC
    If you're constructing SQL statements, you avoid putting quotation marks around a string that allready been formatted with DBI's quote method.

    This is analogous as to how shell arguments constructed using the quotemeta function should be treated, ie:

    $ perl -e '$qs=quotemeta("|"); system( qq{echo $qs} );'

      Ah! Quoted strings were stuck in my mind, probably because we were just talking about them and that's how it's done in Perl.

      perl -e '$qs=quotemeta("|"); eval( qq{print "$qs"} );'