$CountryName = $CountryCode{$Country} || undef; #### #!/bin/perl -w use strict; use Socket; my $ip_addr = '207.127.235.77'; my $remote_host = gethostbyaddr(inet_aton($ip_addr),AF_INET); # get www.xxx.xxx.uk my %CountryCode = ( 'com','Comercial', 'uk','The United Kingdom' ); # a hash of country names my @CCode = split /\./, $remote_host; # split every portion my $Country = $CCode[-1]; # get the last my $CountryName = $CountryCode{$Country} || "Country Unknown"; print $CountryName; #### ___ -DA > perl -MPOSIX -le '$ENV{TZ}="EST";print ctime(1000000000)' Sat Sep 8 20:46:40 2001