in reply to Re^4: system command
in thread system command

huh? I've presented two ways of getting a child's output already! (qx// and open '-|')

Update: Here's a third way:

use IPC::Open2 qw( open2 ); sub line_count { my ($fname) = @_; my $pid = open2(my $fr_child, undef, 'cat', $fname) or die; 1 while <$fr_child>; waitpid $pid, 0; return $.; }