Deni has asked for the wisdom of the Perl Monks concerning the following question:

Hi all !

I've wrote a SOAP::Lite - Server in Perl with several modules. One module is kind of "executing" - module and executes the commands given by the params of the module.

I send my SOAP call to the server and the server executes it and sends me the response of the call. Now I have a problem regarding the translation of double quotes.

The request I send to the server looks like this:

/bin/bash -c 'echo "$(echo "paramter" | program )"'

but when it arrives at the server it looks like this:

/bin/bash -c 'echo "$(echo "paramter" | program )"'

I don't know why the quotes are not translated, because I ran the command on another machine and there it works fine.

Any ideas what the problem could be ? Maybe a wrong version of perl libs ?

Thanks for your help

Edited by planetscape - added code tags

Replies are listed 'Best First'.
Re: Translation of quotes
by philcrow (Priest) on Oct 31, 2005 at 17:00 UTC
    SOAP travels over XML. It must entify your quotes to keep them from interfering with the normal meaning of quotes in XML. You must just de-entify them on the receiving end. Try:
    $command =~ s/"/"/g;
    There are no doubt modules which will do this for you, but I haven't worked with them recently enough to remember which ones.

    Phil

Re: Translation of quotes
by spatterson (Pilgrim) on Oct 31, 2005 at 16:59 UTC
    Well, SOAP is a version of XML, so it seems that SOAP::Lite is being 'helpful' and translating any non :alnum: characters into their corrsponding entity representation http://www.w3.org/International/questions/qa-escapes.html

    So you could easily s/"/\"/g for this case, there's probably also a more generic solution with map or pack.

    just another cpan module author
Re: Translation of quotes
by davorg (Chancellor) on Oct 31, 2005 at 16:58 UTC

    The problem is on line 26 of your program.

    (It may actually be on a different line, but it's been a long day and my telepathy isn't working too well.)

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg