in reply to Call Python script and pass arguments from Perl script

try quotemeta

DB<109> $text=q{a'b"c}; print quotemeta($text) a\'b\"c DB<110> $name="Daffy Duck"; => "Daffy Duck" DB<111> print "'\Q$name\E' '\Q$text\E'" 'Daffy\ Duck' 'a\'b\"c'

not sure if you really still need the single-quotes.

Cheers Rolf

( addicted to the Perl Programming Language)

edit
expanded example
  • Comment on Re: Call Python script and pass arguments from Perl script (quotemeta)
  • Download Code