Gossamer Forum
Home : General : Perl Programming :

Net::Whois::Raw

Quote Reply
Net::Whois::Raw
Anyone got any idea why I get the following error with this code;

Code:
eval {
require Net::Whois::Raw ('whois');
};

if ($@) { print "Error: <BR><BR>$@"; exit; }


Quote:
Software error:
Unable to load plugin: Spider ([Wed Aug 6 04:03:54 2003] admin.cgi: [Wed Aug 6 04:03:54 2003] admin.cgi: syntax error at /home/www/admin/Plugins/Spider.pm line 253, near "require Net::Whois::Raw" [Wed Aug 6 04:03:54 2003] admin.cgi: [Wed Aug 6 04:03:54 2003] admin.cgi: BEGIN not safe after errors--compilation aborted at /home/www/admin/Plugins/Spider.pm line 266. ) at /home/www/admin/admin.cgi line 200.
For help, please send mail to the webmaster (root@fatima.cmd-epubs.com), giving this error message and the time and date of the error.


I'm a little confused as to why this works on some server, but not others. If I use;


Code:
eval {
require Net::Whois::Raw;
};

if ($@) { print "Error: <BR><BR>$@"; exit; }


... I get;


Quote:
Error:

[Wed Aug 6 04:10:13 2003] admin.cgi: [Wed Aug 6 04:10:13 2003] admin.cgi: Compilation failed in require at /usr/lib/perl5/site_perl/5.005/Net/Whois/Raw.pm line 3.


Anyone got any ideas?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Net::Whois::Raw In reply to
Your require statement is completely wrong.

RTFM.

require Net::Whois::Raw;
import Net::Whois::Raw qw/whois/;

Last edited by:

Paul: Aug 6, 2003, 2:12 AM
Quote Reply
Re: [Paul] Net::Whois::Raw In reply to
Thanks for the suggestion. It kinda works, in the sense that it doesn't bring up an error about not being able to find Net::Whois::Raw, but it now gives me this error, whenever I use whois();

Quote:
Software error:
odod.state.oh.us (4200): Unknown method 'whois' called at /home/ohiobiz/linkssql2/admin/Plugins/Spider.pm line 365.

Any ideas?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Net::Whois::Raw In reply to
Yeah because you are importing. You need to specify the class.

Net::Whois::Raw::whois
Quote Reply
Re: [Paul] Net::Whois::Raw In reply to
You refering to something like;

$val = Net::Whois::Raw::whois($url);

Unsure

... if so, I tried that...and it gives;

Code:
Software error:
Undefined subroutine &Net::Whois::Raw::whois called at /home/linkssql2/admin/Plugins/Spider.pm line 365.

Any ideas?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Net::Whois::Raw In reply to
You should import the name in case the module is doing something strange and doesn't let you call it like that:

Code:
eval {
require Net::Whois::Raw;
import Net::Whois::Raw qw/whois/;
};
if ($@) {
die "Net::Whois::Raw not installed: $@";
}
print whois("gossamer-threads.com");'

Cheers,

Alex
--
Gossamer Threads Inc.