in reply to Re: Calling another script from Perl/Tk
in thread Calling another script from Perl/Tk

Thanks for the help! However, could you guide me a little bit farther. I have tried to change my code to this:
open SCRIPT, "otherScript.pl |" or die "script failed: $!"; $resultsBox->insert('end', $SCRIPT);
I am sure that I am not implementing this correctly. I am assuming that I will need to do a loop of some sort to keep inserting the new lines until the script is finished. But, I am at a loss with the new code you gave me. Also, I don't know what you mean by I could use <SCRIPT>. My separate code is line-based and should only pass text. I did put a line in my called script of $| = 1;.

Replies are listed 'Best First'.
Re^3: Calling another script from Perl/Tk
by Illuminatus (Curate) on Oct 22, 2008 at 20:35 UTC
    You must be really new to perl. SCRIPT in this case is a filehandle, not a scalar or array. You should be able to do something like
    open SCRIPT, "otherScript.pl |" or die "script failed: $!"; while (<SCRIPT>) { $resultsBox->insert('end', $_); } close SCRIPT;