in reply to Re: Exec TCL script from Perl?
in thread Exec TCL script from Perl?
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Exec TCL script from Perl?
by cdarke (Prior) on Dec 08, 2008 at 17:05 UTC |