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__
In reply to Re: Finding the Top Level Domain from a URL
by Anonymous Monk
in thread Finding the Top Level Domain from a URL
by downer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |