The URI module can parse URIs for you in a nice OO-ish way. To get the domain part:
my $url = URI->new( "http://www.stackoverflow.com/" );
my $domain = $url->host;
print $domain;
More Related Contents:
- Remove Text between two Strings
- Convert Bash script to Perl/VBS/any other windows compatible language [closed]
- Redirecting the perl script
- How can I troubleshoot my Perl CGI script?
- Why are Perl 5’s function prototypes bad?
- How is Perl’s @INC constructed? (aka What are all the ways of affecting where Perl modules are searched for?)
- How can I install Perl modules without root privileges?
- How do I compare two strings in Perl?
- What is the difference between ‘my’ and ‘our’ in Perl?
- Difference between &function and function() in perl [duplicate]
- How do you round a floating point number in Perl?
- Why are Perl source filters bad and when is it OK to use them?
- Why do I have to specify the -i switch with a backup extension when using ActivePerl?
- How can I run Perl system commands in the background?
- Why is this program valid? I was trying to create a syntax error
- How can I convert the stringified version of array reference to actual array reference in Perl?
- Find size of an array in Perl
- What does the -> arrow do in Perl?
- What’s the difference between iterating over a file with foreach or while in Perl?
- What’s the differences between system and backticks and pipes in Perl?
- In Perl, how can I find the index of a given value in an array?
- How do I tell what type of value is in a Perl variable?
- What should I use for a Perl script’s shebang line?
- How can I find memory leaks in long-running Perl program?
- Why do Perl variables need to start with $, %,@ (sigils)?
- Print lines from one file that are not contained in another file
- Perl DBD::Oracle Module installation
- Nested subroutines and Scoping in Perl
- Explain the deviousness of the Perl “preamble”
- Why doesn’t Perl’s each() iterate through the entire hash the second time?