pg has asked for the wisdom of the Perl Monks concerning the following question:
Now my problem is that it will not quit the while loop, as there is no eof coming in. So, how can I fix this? ( I also tried open3, the same thing)#!/usr/bin/perl use IPC::Open2; use strict; my ($reader, $writer); my $pid = open2($reader, $writer, "sh") || die "failed"; print $writer "history\n"; while (<$reader>) { print "[", $_, "]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Expect) Re: question for open2, and by the way, resolves an old thread
by bbfu (Curate) on Jan 17, 2003 at 19:38 UTC | |
by pg (Canon) on Jan 17, 2003 at 19:46 UTC | |
by tye (Sage) on Jan 17, 2003 at 20:43 UTC | |
by jdporter (Paladin) on Jan 17, 2003 at 19:42 UTC | |
|
Re: question for open2, and by the way, resolves an old thread
by Helter (Chaplain) on Jan 17, 2003 at 21:39 UTC | |
|
Re: question for open2, and by the way, resolves an old thread
by gjb (Vicar) on Jan 17, 2003 at 20:44 UTC |