raflach has asked for the wisdom of the Perl Monks concerning the following question:
NOTE: The code is not complete, but I wasn't going to bother adding things like alrm handlers and whatnot until I knew that this would at least work in a normal situation.#!/usr/local/bin/perl use IPC::Open2; $SIG{CHLD} = sub { $i = 1 }; local ( *RD, *WR ); print "Opening $ARGV[0]\n"; my $child = open2(\*RD, \*WR, "$ARGV[0]") || die "couldn't open $ARGV[ +0]"; print "Finished opening $ARGV[0]\n"; $i = 0; while (1) { $prompt = <RD>; print $prompt; last if ( $i = 1 ); $cmd = <STDIN>; $cmd1 = "'".$cmd."'"; print WR "$cmd"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:
by DrManhattan (Chaplain) on Jul 05, 2000 at 23:28 UTC | |
|
Re: Untitled question
by ahunter (Monk) on Jul 05, 2000 at 21:45 UTC | |
|
Re:
by raflach (Pilgrim) on Jul 05, 2000 at 20:55 UTC | |
|
Re:
by c-era (Curate) on Jul 05, 2000 at 21:44 UTC |