Mahmoud A. Mehyar

NAME

URI::Simple - Simple way to parse uri

SYNOPSIS

  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;
  ....
  

DESCRIPTION

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

Methods;

path

returns URI path

query

return parsed query string as hash ref key,value if key has multiple values value will be an array ref

source

returns URI source - ex: google.com

protocol

returns uri protocol - http, https, ftp ...

port

returns URI port if available

directory

returns URI directory = path without the file name

file

returns URI file's name : ex. index.html

querystring

return raw query string

anchor

returns anchor part of the URI

userInfo
user
password
host
relative
authority

EXPORT

None by default.

AUTHOR

Mamod A. Mehyar, <mamod.mehyar@gmail.com>

COPYRIGHT AND LICENSE

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.