use URI::Split qw/uri_split/; my $url = 'http://www.google.com'; my ($proto, $fqdn) = uri_split($url); print "Protocol:$proto Domain:$fqdn\n";