in reply to Using Linux Commands in Perl - `Backticks`
See the pipe-form of open:
my $cmd = 'netcat localhost 12345 |'; my $pid = open my $netcat, $cmd or die "Couldn't spawn [$cmd]: $!"; for (1..100) { my $line = <$netcat>; print $line; }; END { # Clean up leftover processes kill 9 => $pid if $pid; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Linux Commands in Perl - `Backticks`
by JavaFan (Canon) on Sep 30, 2010 at 21:47 UTC | |
by Corion (Patriarch) on Sep 30, 2010 at 22:16 UTC | |
by JavaFan (Canon) on Oct 01, 2010 at 08:54 UTC | |
by Corion (Patriarch) on Oct 01, 2010 at 12:31 UTC | |
by JavaFan (Canon) on Oct 01, 2010 at 13:43 UTC | |
| |
|
Re^2: Using Linux Commands in Perl - `Backticks`
by ThirtySecondNoob (Novice) on Sep 30, 2010 at 23:20 UTC |