http://qs321.pair.com?node_id=260408


in reply to How do you extract the server from a URL?

Use the URI module.

use URI; my $url = 'http://www.perlmonks.org/index.pl'; my $uri = URI->new($url); my $server = $uri->host; print "URL: $url\n"; print "Server: $server\n";