techie411 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, I am a Perl beginner and I have a whois script that takes IPs from a file and is supposed to grab the ARIN whois information, however I am getting an error:
"Modification of non-creatable array value attempted, subscript -1 at /usr/lib/perl5/site_perl/5.8.8/Net/Whois/ARIN.pm line 391."
Can anyone let me know what I'm doing wrong? Thank you.
#!/usr/bin/perl use Net::Whois::ARIN; my $file="file_containing_IPs.txt"; open(LIST,$file) or die "Unable to open file $file:$!\n"; my $w = Net::Whois::ARIN->new( host => 'whois.arin.net', port => 43, timeout => 30, ); while(<LIST>) { foreach ($_) { chomp; my @output = $w->network($_); foreach my $net(@output) { printf( "CIDR: %s\tNetName: %s\tNetHandle: %s\n", $net->CIDR, $net->NetName, $net->NetHandle, ); } } } close(LIST);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Modification of non-creatable array value attempted, subscript -1" Error
by MVS (Monk) on Oct 26, 2011 at 06:37 UTC | |
|
Re: "Modification of non-creatable array value attempted, subscript -1" Error
by GrandFather (Saint) on Oct 26, 2011 at 06:59 UTC | |
|
Re: "Modification of non-creatable array value attempted, subscript -1" Error
by BrowserUk (Patriarch) on Oct 26, 2011 at 06:39 UTC | |
|
Re: "Modification of non-creatable array value attempted, subscript -1" Error
by Anonymous Monk on Oct 26, 2011 at 07:04 UTC |