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 $.; }
In reply to Re^5: system command
by ikegami
in thread system command
by megaurav2002
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |