Can any one please help, the code works...I want the output of $result to be saved in an output.txt file which is lcoated in c:\\temp\\output.txt.
$filepath="C:\\temp\\ip.txt";
open (HOSTLIST,"$filepath");
@hosts=(<HOSTLIST>);
foreach $host(@hosts)
{
$results = `nslookup $host`;
chomp ($host);
print ("Results for $host:\n");
print ("$results\n\n");
}
close (HOSTLIST);