Unfortunately I need to call a tcl script first to setup my TCL environment. I found this script online but it doesn't seem to create the process so I can enter my STDIN
use strict;
use warnings;
use Sockets;
$wishbin = 'C:\Progra~1\TclScripts\bin\wish84.exe C:\Progra~1\bin\
+WishSetup.tcl';
die "socketpair unsuccessful: $!!\n" unless socketpair(W0,WISH84,1
+,1,0);
if ($pid=fork) {
print "PID: $pid\n";
select(WISH84); $| = 1;
select(STDOUT);
print WISH84 'source TCL_Script.tcl',"\n";
# Here is the main loop which receives and sends commands
# to wish.
while (<WISH84>) {
chop;
print "Wish sais: <$_>\n";
if (/^quit/) { print WISH84 "destroy .\n"; last; }
}
wait;
} elsif (defined $pid) {
open(STDOUT, ">&W0");
open(STDIN, ">&W0");
close(W0);
select(STDOUT); $| = 1;
exec "$wishbin --";
} else {
die "fork error: $!\n";
}
|