in reply to Execute a command line and save in memory its output

You can open a program for reading it's output: see open for details.

Something like this will just suffice:

open my $cmd, "ncks -v $variable -d station,$id,$id $file|" or die "un +able to open a CMD for read!"; while (<$cmd>) { next unless $_ =~ /station\[/; # put your grep logic in perl side too +! chomp; ...

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Execute a command line and save in memory its output
by Anonymous Monk on Apr 29, 2016 at 09:32 UTC
    Thanks!