Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Execute a command line and save in memory its output

by Discipulus (Canon)
on Apr 29, 2016 at 08:39 UTC ( [id://1161859]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-20 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found