in reply to termination of system command
#!/usr/bin/perl use strict; use warnings; open(STAT, '-|', 'vmstat 2') or die "Could not open pipe: $!"; my $count; # not necessary, just for demonstration while (<STAT>){ last if $count++ > 5; # we don't want more than 5 lines of out +put print $_, "\n"; } print "...done\n";
|
|---|