Hi All,

Please check the below CGI Script which executs a simple list command on the remote box and prints the output on the HTML page. This displays the webpage only after the command execution is done. What I need to achieve is to display the page immediately after the command execution and then show the output of the command as and when it comes.

Please let me know if you have any ideas on how to proceed. I posted here with lot of expectations :)
use strict; use CGI qw(:all); # import shortcuts use Fcntl qw(:flock); # imports LOCK_EX, LOCK_SH, LOCK_NB use CGI::Carp qw(warningsToBrowser fatalsToBrowser); # For Debugging use Net::SSH::Perl; print header; my ( $TITLE, # page title & header $DeploySvr, $KIT, $ssh, $UNM, $Pass, $stdout, $stderr, $exit, $cmd, ); $TITLE = "UNIX Deployment Tool"; $DeploySvr=param('DrpServer'); $KIT=param('TxtKit'); $UNM=param('username'); $Pass=param('password'); $ssh = Net::SSH::Perl->new('113.128.160.214'); $ssh->login($UNM, $Pass); $cmd="ls -l"; my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print start_html($TITLE); print h1($TITLE); print hr, start_form; print $stdout; print $stderr; print endform, hr; print h2("Prior Messages"); print end_html;
Thanks

In reply to Asynchronous Processing a command execution by Alfaromeo

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.