laziness, impatience, and hubris | |
PerlMonks |
Re: Storing system grep's output to an array in perlby vinoth.ree (Monsignor) |
on Mar 07, 2013 at 11:32 UTC ( [id://1022206]=note: print w/replies, xml ) | Need Help?? |
system() executes the command specified but it doesn't capture the output of the command. system() will return the exit status of the command as returned by the 'wait' call. Update:Use backtick(``) to capture the specified command's output. my @array = `grep -i "top-" filename | awk '(print $3)'`;
In Section
Seekers of Perl Wisdom
|
|