my $line; open(OUTPUT, "|command that gets output") or die "dead"; while() { if (/Buffers/) { $line = ; last; } } close(OUTPUT);