3 use Net::Whois::Raw qw( whois $OMIT_MSG $CHECK_FAIL $TIMEOUT $CACHE_DIR );
6 use vars qw($opt_s $opt_c $opt_S $opt_C $opt_t $opt_T $opt_h);
12 $0 [ -s | -S ] [ -c | -C ] [ -t <timeout> ] [ -T] <domain> [ <server> ]
14 The -s switch attempts to strip the copyright message or disclaimer.
15 The -S switch will attempt some exra rules for it.
16 The -c switch attempts to return an empty answer for failed searches.
17 The -C switch will attempt some exra rules for it.
18 The -T switch takes a parameter that is used for the timeout for
20 The -t switch enables caching.
26 $OMIT_MSG = $CHECK_FAIL = 0;
28 $OMIT_MSG = 1 if $opt_s;
29 $OMIT_MSG = 2 if $opt_S;
30 $CHECK_FAIL = 1 if $opt_c;
31 $CHECK_FAIL = 2 if $opt_C;
37 $CACHE_DIR = $ENV{'TEMP'} || "C:\\temp";
39 $CACHE_DIR = $ENV{'TEMP'} || "/tmp";
40 my @ent = getpwuid($>);
42 foreach ("/tmp/$ent[0]", "$ent[7]/.pwhois") {
44 if (open(O, ">$_/__$$-$$.tmp")) {
46 unlink "$_/__$$-$$.tmp";
55 my $dom = $ARGV[0] || die "Usage: $0 domain";
57 my $server = $ARGV[1];
60 my $result = whois($dom, $server);
64 print STDERR "Failed.\n";
69 $err =~ s/\s+at \S+ line \d+\.$//;
70 print "\nWhois information could not be fetched:\n$err\n";
78 pwhois - Perl written whois client
84 pwhois -s police.co.il
85 pwhois -c there.is.no.tld.called.foobar
86 pwhois yahoo.com whois.networksolutions.com
93 Just invoke with a domain name, optionally with a whois server name.
94 The B<-s> switch attempts to strip the copyright message or disclaimer.
95 The B<-c> switch attempts to return an empty answer for failed searches.
96 The B<-T> switch takes a parameter that is used for the timeout for
101 Ariel Brosh, B<schop@cpan.org>