You could do something like this:
use strict; use warnings; my $nodeName = "www.perlmonks.org"; open(NS,"nslookup $nodeName|") or die; my @ns = grep {chomp; s|^.*:\s*||; $_} <NS>; close(NS); print join("\n",@ns), "\n"; # or "$ns[3]\n", etc.
In reply to Re: capturing and parsing multiline output
by hbm
in thread capturing and parsing multiline output
by ScooterTrash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |