You are presumably trying to do this using `backtics`. Bacticks capture the scripts output into a variable. In fact the "hang" is the program you are running waiting patiently for your input (with the prompt captured by the backtics):

C:\>perl -e "print 'Hello '; system('date'); print 'world'"; Hello The current date is: Tue 17/06/2008 Enter the new date: (dd-mm-yy) 17-06-08 world C:\> C:\>perl -e "print 'Hello '; `date`; print 'world'"; Hello 18-06-08 <--- type in data here world C:\>date The current date is: Wed 18/06/2008 [snip] C:\>perl -e "print 'Hello '; $p = `date`; print $p.' world'"; Hello 17-08-08 The current date is: Tue 17/06/2008 Enter the new date: (dd-mm-yy) world C:\>

In reply to Re: Execute Interactive commands by tachyon-II
in thread Execute Interactive commands by sonalig

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.