Your description is a bit vague. I assume that you have a perl variable that happens to have double quote characters inside it, though why that would be needed in XML is a bit beyond me (XML is its own delimiter, and shouldn't need extra ones).

Removing double quotes from around a Perl string is pretty easy:

$string =~ s/^"(.*)"$/$1/; # or (faster if you always have quotes): $string = substr($string, 1, length($string)-2);
Though this doesn't answer the question about what to do with embedded quotes.

Anyway, you are sending this string to some other software somehow.

Here's where it gets difficult. There are several ways to send data to other programs:

The solution for each of these is likely to be different.

If you're using system() or qx(), you have to watch out for the quoting behavior of your local shell (which might view double quotes as special).

More info is needed...


In reply to Re: How to remove double quotes? by bikeNomad
in thread How to remove double quotes? by basicdez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.