I am not a Unix GURU, so some of the usage for rsh that I have below is probably jacked up, but Sounds like this is the scenario to me.

$string = "This is my string"; my $output = `rsh -l remoteuser host.example.com "perlprog.pl $string" +`;

With the above code, $string is going to equal This is my string not "This is my string". Therefore when rsh is called as an external application, the resulting command on the remote system is perlprog.pl This is my string instead of the desired perlprog.pl "This is my string"

Seems like you should be able to add the double quotes to the parameter by escaping them. Similar to the following.

$string = "This is my string"; my $output = `rsh -l remoteuser host.example.com "perlprog.pl \"$strin +g\""`;

In reply to Re^3: Double double quoting - nested macro calls by SitrucHtims
in thread Double double quoting - nested macro calls by kenm

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.