Shawn H Corey wrote:
Brandon McCaig wrote:
my $cmdline = "echo 'DIS CHS(*)' | runmqsc SQFR | grep CHANNEL | sort
| uniq -c";
# Open input pipe from command line.
open(my $pipe, "-|", $cmdline);
open my $pipe, '-|', $cmdline or die "could not open pipe: $!\n";
for my $line (<$pipe>)
while( my $line = <$pipe> )
{
# Parse columns from $line here.
# For example, let's just print them.
print $line;
}
close($pipe);
close $pipe or die "could not close pipe: $!\n";
close $pipe or die $! ? "could not close pipe: $!"
: "Exit status $? from pipe";
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/