2 URI::Template - Object for handling URI templates (RFC 6570)
7 my $template = URI::Template->new( 'http://example.com/{x}' );
8 my $uri = $template->process( x => 'y' );
12 my $template = URI::Template->new();
13 $template->template( 'http://example.com/{x}' );
14 my $uri = $template->process( x => 'y' );
16 # uri is a URI object with value 'http://example.com/y'
19 This module provides a wrapper around URI templates as described in RFC
20 6570: <http://tools.ietf.org/html/rfc6570>.
30 Creates a new URI::Template instance with the template passed in as the
31 first parameter (optional).
34 This method returns the original template string. If provided, it will
35 also set and parse a new template string.
38 Returns an array of unique variable names found in the template. NB:
39 they are returned in random order.
42 This method returns an list of expansions found in the template.
43 Currently, these are just coderefs. In the future, they will be more
47 Given a list of key-value pairs or an array ref of values (for
48 positional substitution), it will URI escape the values and substitute
49 them in to the template. Returns a URI object.
51 process_to_string( \%vars )
52 Processes input like the "process" method, but doesn't inflate the
53 result to a URI object.
56 * Brian Cassidy <bricas@cpan.org>
58 * Ricardo SIGNES <rjbs@cpan.org>
61 Copyright 2007-2015 by Brian Cassidy
63 This library is free software; you can redistribute it and/or modify it
64 under the same terms as Perl itself.