Nathaniel Wert wrote:
>
> I am trying to make a feable attempt at parsing a nslookup call. All I actually
>want is the IP address. So I figured I would do the following:
>
> $ticker = 0;
> foreach $_ (`nslookup $nodename`) {
> $_ = $out[$ticker];
> $ticker++;
> }
>
> print $out[0];
>
>
There are a couple of very strange things with your questions and code ..
firstly you dont need to put the $_ in the foreach line ... if you dont put
anything there then it will pull the value into $_ on each iteration
secondly your question that $_ was an array is clearly wrong ... $_ can only
be
Not sure if i am out of line here but shouldnt it be
$out[$ticker] = $_ ;
instead of
$_ = $out[$ticker];
On Fri, Nov 02, 2001 at 11:05:09AM -0500, Wert, Nathaniel shaped the electrons to read:
> I am trying to make a feable attempt at parsing a nslookup call. All I actually
>want i
I am trying to make a feable attempt at parsing a nslookup call. All I actually want
is the IP address. So I figured I would do the following:
$ticker = 0;
foreach $_ (`nslookup $nodename`) {
$_ = $out[$ticker];
$ticker++;
}
print $out[0];
I am getting a uninitalized error for $out[0].