$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:
- through the system() call
- using qx() or backticks
- through an API like OLE
- via temporary files
- through data in a pipe
- through data over a socket or datagram connection
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... |