On Wed, Sep 28, 2016 at 5:15 PM, Nex6 via perl6-users
wrote:
> my $results = run 'ping', '-c', '1',$line;
>
> where $line is the IP address, $results hold the result how can i pull the
> results out? it outputs like this:
>
Actually, it doesn't have them with that invocation; they went to stdout,
which is probably your terminal. In any case, $result is a Proc object
representing the thing you ran, and will get the exit status when ping
exits.
my $proc = run 'ping', '-c', '1', $line, :out;
my $result = $proc.out.lines;
This tells `run` to capture the output with the Proc object, and you can
retrieve it with the `out` method (which returns an IO::Handle) as above.
--
brandon s allbery kf8nh sine nomine associates
allber...@gmail.com ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net