Getting closer....
Apparently you can't directly manipulate STDERR before it gets printed (makes since now that I think about it). What I've come up with is a subroutine that grabs the current Text data and empties the Text box. I then split it up and parse out the Net::FTP junk that gets prepended to everything, discarding blank lines and Perl warnings that also make their way into the Text widget. I can then insert only what I want back. This gets run after every command. Unfortunately however, sometimes there's a noticable delay between when the raw data gets printed and when it gets parsed and re-printed.
Code:
sub fix_log {
$log->update;
my @log = split /\n/, $log->get("1.0", "end");
$log->delete("1.0", "end");
foreach my $line (@log) {
if ($line !~ /^Net\:\:FTP/ && $line !~ /^\s*$/) {
$log->insert("end", "$line\n")
}
elsif ($line =~ /(>>>|<<<)\s+(.+)$/) {
$log->insert("end", "$2\n");
}
else {
next
}
}
}
Philip
------------------
Limecat is not pleased.