Or even better:
my @tops; open my $inputFileHandle, '<', $filename or die "could not open '$file +name', because the OS said: $!"; while ( <$inputFileHandle> ) { if ( m/^top \- (\d{2}:\d{2}:\d{2})/ ) { push @tops, $1; } }
In reply to Re^2: Storing system grep's output to an array in perl
by SuicideJunkie
in thread Storing system grep's output to an array in perl
by tc_blr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |