in reply to termination of system command

Hi,
you can also open it with '-|' (pipe from vmstat) and then use a while-loop as shown below:
#!/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";

Regards,
svenXY