in reply to Perl:TK - standard output to text widget
If it is output from your own script, do yourself a favor, and simply change all the relevant print statements with calls to a routine that appends to the widget.
If not, are you trying to catch the output of some command that completes quickly? (like, say, man or ls)
In that case, use $var=`command` to capture the stdout of the command into your variable.
If it is the output of a program that will take a while to execute, and produce output at various points in time, then you should open that program with a pipe, like so:
. In the last case you will have to arrange something that will check for new output on a regular basis. File::Tail may be of some use with that.open(COM,"command |") || die "Could not execute command\n";
|
|---|