Don't use system, use backticks to get the output of the command. $foo = `cat foobar.txt`; print FH $foo;
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Carter A. Thompson Sent: Thursday, March 21, 2002 1:39 PM To: Perl Users Subject: Filehandle and Widget printing. I have a Perl/Tk script that executes a system command. What I'd like to do is capture the output from this system command and redirect it to both a filehandle and a text widget. print FH "some string\n"; # This prints to the logfile $text->insert('end; "some string\n"); # This prints to the text widget system("cat foobar.txt"); Now, how to I get the output from the system command into the filehandle and into the text widget? I'm obviously overlooking something. I would do a "tee" but I don't think I can tee to a widget, or can I? Any help is greatly appreciate. Carter. _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002 _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs