Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Storing system grep's output to an array in perl

by SuicideJunkie (Vicar)
on Mar 07, 2013 at 19:03 UTC ( #1022290=note: print w/replies, xml ) Need Help??


in reply to Re: Storing system grep's output to an array in perl
in thread Storing system grep's output to an array in perl

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; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022290]
help
Chatterbox?
[1nickt]: ambrus that's why you should never take sugar or milk in your tea.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-11-21 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (302 votes). Check out past polls.

    Notices?