in reply to Finding the Top Level Domain from a URL
URI, Net::Domain::TLD, Regexp::Common::URI#!/usr/bin/perl -- use strict; use warnings; use URI; my $uri = URI->new('http://www.someurl.com/index.html'); my @host = split /\./, $uri->host; my $tld = $host[-1]; print "$tld\n"; __END__
|
|---|