2 URI::Template - Object for handling URI templates
6 my $template = URI::Template->new( 'http://example.com/{x}' );
7 my $uri = $template->process( x => 'y' );
8 # uri is a URI object with value 'http://example.com/y'
10 my %result = $template->deparse( $uri );
11 # %result is ( x => 'y' )
14 This is an initial attempt to provide a wrapper around URI templates as
16 http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-00.txt
19 To install this module via Module::Build:
22 ./Build # or `perl Build`
23 ./Build test # or `perl Build test`
24 ./Build install # or `perl Build install`
26 To install this module via ExtUtils::MakeMaker:
35 Creates a new URI::Template instance with the template passed in as the
39 Returns the original template string. Also used when the object is
43 Returns an array of variable names found in the template. NB: they are
44 returned in random order.
47 Given a list of key-value pairs, it will URI escape the values and
48 substitute them in to the template. Returns a URI object.
50 process_to_string( %vars )
51 Processes key-values pairs like the "process" method, but doesn't
52 inflate the result to a URI object.
55 Does some rudimentary deparsing of a uri based on the current template.
56 Returns a hash with the extracted values.
59 * Brian Cassidy <bricas@cpan.org>
62 Copyright 2007 by Brian Cassidy
64 This library is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.