From: <Chr...@ti...> - 2001-01-19 19:12:57
|
try tieing STDOUT to a scalar with IO:Scalar. Here's an example (untested) that may point you in the right direction: use IO::Scalar; my $FTPInfo; tie *STDOUT, 'IO::Scalar', \$FTPInfo; print "line 1\nline 2\n", "line 3\n"; $SB->Text($FTPInfo); HTH, tcl...@we... -----Original Message----- From: Kevin.ADM-Gibbs@Alcan.Com [mailto:Kevin.ADM-Gibbs@Alcan.Com] Sent: Friday, January 19, 2001 8:08 AM To: er...@e-... Cc: per...@li... Subject: Re: [perl-win32-gui-users] Net::FTP with AddStatusBar() Erick, I'm convinced that there must be a simple way to do this but, I've tried everything I can think of but haven't found it yet. The PerlDocs seemed to suggest using Forks, Pipes and/or IPC, but this will probably be abit more complicated than you want. You could redirect STDOUT (and/or STDERR) to a file while you do the ftp stuff, and read the contents of the file back once you've finished. Doesn't seem right to have to do it that way though. Kev. er...@e-... on 19/01/2001 06:01:40 To: per...@li... @ INTERNET cc: Subject: [perl-win32-gui-users] Net::FTP with AddStatusBar() I guess my question was really how to catch it from Net::FTP. For example, catch the STDOUT so that I could have $FTPInfo = "331 User name okay, need password." > >Is there a way to catch the STDOUT from using Net::FTP (ie. let $FTPInfo > >equal the information (string) from Net::FTP) and place it in > > > >$SB = $Window->AddStatusBar(-text => $FTPInfo); > > $SB->Text($FTPInfo); > > should do the trick. erick _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |