k0rn has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # Whois script use CGI qw(:standard escapeHTML); use Net::Whois::Raw qw( whois ); # Get values from form my $domain = param('domain'); # Check for blanks unless (param('domain')){noname('a domain')}; #Get whois information $whois = whois($domain); #Print whois information print "Content-type: text/html\n\n"; HEADER('Results'); print <<EOT; $whois EOT FOOTER(); exit; # We stop here # Header subroutine sub HEADER { my($title) = @_; print <<EOT; <HTML> <HEAD> <TITLE>$title</TITLE> </HEAD> <body bgcolor="#263C6D" text="white" link="#ffffff" vlink="#C0C0C0" al +ink="#C0C0C0"> EOT } # Noname Subroutine sub noname { my($reason) = $_[0]; print "Content-type: text/html\n\n"; HEADER('Blank Entry'); print <<EOF; <H1><center>Incomplete</H1></center> <center>Please fill in all required fields. You are missing $reaso +n</center> EOF FOOTER(); exit; #we Stop Here } # Footer Subroutine sub FOOTER { print <<EOT; </BODY> </HTML> EOT }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Whois::Raw qw( whois );
by quester (Vicar) on Apr 21, 2009 at 01:26 UTC | |
by Anonymous Monk on Aug 24, 2009 at 18:35 UTC |