use URI qw( ); my $host = URI->new('http://www.google.co.uk/')->host(); die("No domain\n") if !defined($host) || $host =~ /^[\d.]*\z/; my ($tld) = $host =~ /\.([^.]*)\.?\z/; print("$tld\n"); # uk
In reply to Re: find the domain name from subdomian
by ikegami
in thread find the domain name from subdomian
by susmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |