#!/usr/local/bin/perl -w # Prints the Gossamer Threads Home Page greeting. # Author: Alex Krohn (alex@gossamer-threads.com) # NOTE: You need the list of domains to country names. I got mine from Analog and # you can find it here: # # http://www.gossamer-threads.com/scripts/source/domains.tab # use strict; print "Content-type: text/html\n\n"; my ($time, $greeting) = &get_date; my $country = &get_country; print qq~
$greeting, and thanks for visiting
Gossamer Threads' website. Your interest in our site is appreciated.
Its $time in beautiful Vancouver, British Columbia, Canada where
Gossamer Threads is located.
~;
if (defined $country and ($country =~ /Canada/i)) {
print qq|It's good to see someone else from Canada!|;
}
elsif (defined $country) {
print qq|What's it like in $country? Let me know!\n"|;
}
exit;
sub get_country {
# --------------------------------------------------------------
my ($match, $code, $name);
if (exists $ENV{'REMOTE_HOST'} and ($ENV{'REMOTE_HOST'} =~ /\.(..)$/)) {
$match = $1;
open (DOMAINS, "./domains.tab") or (print "SYSTEM ERR: CANT OPEN FILE" and exit);
while (