Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Activeperl: Net::Whois::ARIN::Network

by marto9 (Beadle)
on Aug 17, 2008 at 14:51 UTC ( [id://704795]=perlquestion: print w/replies, xml ) Need Help??

marto9 has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monkies.

J/k about that, srry. :p The reason why I post this is because I have a problem with a package that doesn't exist for Activeperl: Net::Whois::ARIN::Network.
I tried to download the package file manually and put it in the appropriate directory(C:\Perl\site\lib\Net\Whois\ARIN\Network.pm), but it doesn't work. I get thesame error.

This is the error that I get when I run my script.

Can't locate Net/Whois/ARIN/Network.pm in @INC (@INC contains: C:/Perl +/site/lib C:/Perl/lib .) at C:\Users\Admin\Desktop\arin.pl line 3. BEGIN failed--compilation aborted at C:\Users\Admin\Desktop\arin.pl li +ne 3.
And this is when I exclude "use Net::Whois::ARIN::Network;":
Can't call method "NetRange" on unblessed reference at C:\Users\Admin\ +Desktop\ar in.pl line 10.
Here's my script:
#!usr/bin/perl use strict; use warnings; use Net::Whois::ARIN; use Net::Whois::ARIN::Network; my $w = Net::Whois::ARIN->new( host => 'whois.arin.net', port => 43, timeout => 30, ); my @output = $w->network("NERSC"); foreach my $net (@output) { print $net->NetRange."\n"; } exit;
I also made another script that works and gives me the output.
But I think it's more resource intensive for the server, because it gives more information than I need.
#!usr/bin/perl use strict; use warnings; use Net::Whois::ARIN; my $w = Net::Whois::ARIN->new( host => 'whois.arin.net', port => 43, timeout => 30, ); my @results = $w->query("NERSC"); foreach $result (@results) { print $result."\n"; } exit;
Url's to packages:
Net::Whois::ARIN::Network
Net::Whois::ARIN

Replies are listed 'Best First'.
Re: Activeperl: Net::Whois::ARIN::Network
by CountZero (Bishop) on Aug 17, 2008 at 15:15 UTC
    Net::Whois::ARIN installed like a breeze on my Windows XP Pro box with AS Perl 5.8 through cpan.

    It is also available on ppm, if that is more to your liking.

    The Net::Whois::ARIN distribution includes the following files:

    Net\Whois\ARIN.pm Net\Whois\ARIN\AS.pm Net\Whois\ARIN\Contact.pm Net\Whois\ARIN\Customer.pm Net\Whois\ARIN\Network.pm Net\Whois\ARIN\Organization.pm
    You have to install the whole distribution for it to work it seems.

    Update: I tried your not working script. After installing through CPAN it works and the answer is 128.55.0.0 - 128.55.255.255

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Activeperl: Net::Whois::ARIN::Network
by marto9 (Beadle) on Aug 17, 2008 at 20:33 UTC
    I reinstalled Activeperl and now it works. Thx for your time CountZero.
Re: Activeperl: Net::Whois::ARIN::Network
by marto9 (Beadle) on Aug 17, 2008 at 15:47 UTC
    Thx for the reply.

    Normally I always install packages through ppm, just like I did with Net::Whois::ARIN.

    Now I'm trying to install the package through cpan.
    I first uninstall the package through ppm. Then I started cpan and I entered the command "install Net::Whois::ARIN".
    But I'm facing a problem. While compiling the package I get a question. I have to answer, but I can't give any input.
    I also get an error. That's why the question pops up.

    Here's the install log:

    C:\Users\Admin>CPAN Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0 +.125) Warning [c:\Program Files\Ruby\bin\inputrc.euro line 1]: Re-binding c +har #91 to non-meta ("[") in emacs_keymap_27 key map Exiting subroutine via last at C:/Perl/lib/CPAN.pm line 1450. cpan shell -- CPAN exploration and modules installation (v1.9205) ReadLine support enabled cpan> install Net::Whois::ARIN CPAN: Storable loaded ok (v2.16) Going to read C:\Perl\cpan\Metadata Database was generated on Fri, 15 Aug 2008 10:03:16 GMT Running install for module 'Net::Whois::ARIN' Running make for T/TC/TCAINE/Net-Whois-ARIN-0.11.tar.gz CPAN: checksum security checks disabled because Digest::SHA not inst +alled. Please consider installing the Digest::SHA module. CPAN: Time::HiRes loaded ok (v1.9707) Scanning cache C:\Perl/cpan/build for sizes ...................................................................... +......DONE CPAN: Compress::Zlib loaded ok (v1.4201) CPAN: Archive::Tar loaded ok (v1.3201) Net-Whois-ARIN-0.11/ Net-Whois-ARIN-0.11/Build.PL Net-Whois-ARIN-0.11/Changes Net-Whois-ARIN-0.11/examples/ Net-Whois-ARIN-0.11/examples/simple.pl Net-Whois-ARIN-0.11/lib/ Net-Whois-ARIN-0.11/lib/Net/ Net-Whois-ARIN-0.11/lib/Net/Whois/ Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/ Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/AS.pm Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/Contact.pm Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/Customer.pm Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/Network.pm Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN/Organization.pm Net-Whois-ARIN-0.11/lib/Net/Whois/ARIN.pm Net-Whois-ARIN-0.11/Makefile.PL Net-Whois-ARIN-0.11/MANIFEST Net-Whois-ARIN-0.11/MANIFEST.SKIP Net-Whois-ARIN-0.11/META.yml Net-Whois-ARIN-0.11/README Net-Whois-ARIN-0.11/t/ Net-Whois-ARIN-0.11/t/00-pod-coverage.t Net-Whois-ARIN-0.11/t/00-pod.t Net-Whois-ARIN-0.11/t/01-connect.t Net-Whois-ARIN-0.11/t/02-as.t Net-Whois-ARIN-0.11/t/03-contact.t Net-Whois-ARIN-0.11/t/04-customer.t Net-Whois-ARIN-0.11/t/05-network.t Net-Whois-ARIN-0.11/t/06-organization.t Net-Whois-ARIN-0.11/t/whois/ Net-Whois-ARIN-0.11/t/whois/as.txt Net-Whois-ARIN-0.11/t/whois/customer.txt Net-Whois-ARIN-0.11/t/whois/network.txt Net-Whois-ARIN-0.11/t/whois/organization.txt Net-Whois-ARIN-0.11/t/whois/poc.txt CPAN: File::Temp loaded ok (v0.18) CPAN: Module::Build loaded ok (v0.2808) CPAN.pm: Going to build T/TC/TCAINE/Net-Whois-ARIN-0.11.tar.gz Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0 +.125) Checking if your kit is complete... Looks good Warning: prerequisite Test::MockObject 1.07 not found. Writing Makefile for Net::Whois::ARIN Could not read 'C:\Perl\cpan\build\Net-Whois-ARIN-0.11-UyOLoA\META.yml +'. Falling back to other methods to determine prerequisites ---- Unsatisfied dependencies detected during ---- ---- TCAINE/Net-Whois-ARIN-0.11.tar.gz ---- Test::MockObject [requires] Shall I follow them and prepend them to the queue of modules we are processing right now? [yes]
      if you cannot give any input into your CPAN-shell, there is something wrong with your CPAN-installation. The right answer should just be hitting "ENTER" and let CPAN automatically install the missing dependencies.

      Also, the fact that your install of CPAN could not read the "META.yml" file seems to indicate something wrong. Did you already try re-installing CPAN? (force install CPAN)

      If all fails, you can still install Test::MockObject separately.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://704795]
Approved by lidden
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-23 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found