Created
March 21, 2011 22:52
-
-
Save riywo/880393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use IPC::Open2 qw(open2); | |
## warning = Name "main::OUT1" used only once: possible typo | |
open2(\*OUT1, undef, 'iostat', '1', '3'); | |
open2(\*OUT2, "<&OUT1", 'cat', '-nu'); | |
print while(<OUT2>); | |
## error = open2: close(main::GLOB(0x827988)) failed: Bad file descriptor | |
my ($out1, $out2); | |
open2($out1, undef, 'iostat', '1', '3'); | |
open2($out2, "<&$out1", 'cat', '-nu'); | |
print while(<$out2>); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment