DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS


       Apache::URI - URI component parsing and unparsing


SYNOPSIS

         use Apache::URI ();
         my $uri = $r->parsed_uri;

         my $uri = Apache::URI->parse($r, "http://perl.apache.org/");


DESCRIPTION

       This module provides an interface to the Apache util_uri
       module and the uri_components structure.


METHODS

       Apache::parsed_uri
           Apache will have already parsed the requested uri com-
           ponents, which can be obtained via the parsed_uri
           method defined in the Apache class.  This method
           returns an object blessed into the Apache::URI class.

            my $uri = $r->parsed_uri;

       parse
           This method will parse a URI string into uri compo-
           nents which are stashed in the Apache::URI object it
           returns.

               my $uri = Apache::URI->parse($r, "http://www.foo.com/path/file.html?query+string");

           This method is considerably faster than using
           URI::URL:

               timethese(5000, {
                   C => sub { Apache::URI->parse($r, $test_uri) },
                   Perl => sub { URI::URL->new($test_uri) },
               });

            Benchmark: timing 5000 iterations of C, Perl...
              C:  1 secs ( 0.62 usr  0.04 sys =  0.66 cpu)
              Perl:  6 secs ( 6.21 usr  0.08 sys =  6.29 cpu)

       unparse
           This method will join the uri components back into a
           string version.

            my $string = $uri->unparse;

       scheme
            my $scheme = $uri->scheme;
            my $hostinfo = $uri->hostinfo;

       user
            my $user = $uri->user;

       password
            my $password = $uri->password;

       hostname
            my $hostname = $uri->hostname;

       port
            my $port = $uri->port;

       path
            my $path = $uri->path;

       rpath
           Returns the path minus path_info.

            my $path = $uri->rpath;

       query
            my $query = $uri->query;

       fragment
            my $fragment = $uri->fragment;


AUTHOR

       Doug MacEachern


SEE ALSO

       perl(1).

Copyright © 2000-2010 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.