URI::Simple - Simple way to parse uri
use URI::Simple; my $uri = URI::Simple->new('http://google.com/some/path/index.html?x1=yy&x2=pp#anchor'); #enable strict mode my $uri = URI::Simple->new('mailto:username@example.com?subject=Topic'); print $uri->path; print $uri->source; ....
This module is a direct port of javascript parseURI regex by Steven Levithan Please See Original Code
This module will attempts to split URIs according to RFC 3986
returns URI path
return parsed query string as hash ref key,value if key has multiple values value will be an array ref
returns URI source - ex: google.com
returns uri protocol - http, https, ftp ...
returns URI port if available
returns URI directory = path without the file name
returns URI file's name : ex. index.html
return raw query string
returns anchor part of the URI
None by default.
Mamod A. Mehyar, <mamod.mehyar@gmail.com>
Copyright (C) 2012-2013 by Mamod A. Mehyar
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install URI::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::Simple
CPAN shell
perl -MCPAN -e shell install URI::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.