Help for this page

Select Code to Download


  1. or download this
    use URI;
    $u1 = URI->new('http://www.comp.leeds.ac.uk/Perl/');
    ...
    else {
       print "oops\n";
    }
    
  2. or download this
    u1.host=www.comp.leeds.ac.uk
    u2.host=www.comp.leeds.ac.uk
    URL's host are the same
    
  3. or download this
    PARSING URIs WITH REGEXP
    As an alternative to this module, the following (official) regular exp
    +ression can be used to decode a URI:
    ...
      my($scheme, $authority, $path, $query, $fragment) =
      $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#
    +(.*))?|;
    The URI::Split module provide the function uri_split() as a readable a
    +lternative.
    
  4. or download this
    use URI;
    $u1 = URI->new('http://www.comp.Leeds.ac.uk/Perl/')->canonical();
    ...
    else {
       print "oops\n";
    }