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

Currently I am using a callback in an sftp->put call. This is CGI based, ad I would like to find a way to display my progress message in the same place in the html page, i.e. overwrite the last message, but clear it first. So far I have gotten to the point where I can overwrite the last message, but I cannot clear what was printed before, so it becomes a garbled mess. I am using Netscape 4.76. I am not adverse to using javascript or DHTML to accomplish this, but I have no clue how to do so.
The following is the code of interest:
use Net::SFTP; sub progress{ my ($sftp, $data, $offset, $total) = @_; my $num_width = length $total; select STDOUT; $|=1; print "<layer>Wrote $offset bytes of $total</layer>"; } sftp->put($File, $RemoteFile, \&progress);

Edit: g0n - replaced pre tags with code tags

Replies are listed 'Best First'.
Re: CGI sftp callback progress meter(?)
by ikegami (Patriarch) on Dec 15, 2005 at 00:02 UTC
    The following will edit (if I got the syntax right) the text a <SPAN> with id my_span:
    print("<script>my_span.innertext = \"Wrote $offset bytes of $total\";< +/script>\n");
      This works great in IE, but not in Netscape or Firefox.
      Any other suggestions?