Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do you extract the server from a URL?

by mendeepak (Scribe)
on Mar 08, 2012 at 11:42 UTC ( [id://958456] : note . print w/replies, xml ) Need Help??


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

use the URI Module

my $url = URI->new( "http://www.perlmonks.org/index.pl" ); my $domain = $url->host; print $domain;

Originally posted as a Categorized Answer.