use strict;
use warnings;
-our $VERSION = '0.07';
+our $VERSION = '0.09';
use URI;
use URI::Escape ();
use overload '""' => \&as_string;
+my $unsafe = q(^A-Za-z0-9\-_.~!\$\&'()*+,;=:/?\[\]#@);
+
=head1 NAME
URI::Template - Object for handling URI templates
=head1 DESCRIPTION
This is an initial attempt to provide a wrapper around URI templates
-as described at http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-00.txt
+as described at http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-01.txt
=head1 INSTALLATION
-To install this module via Module::Build:
-
- perl Build.PL
- ./Build # or `perl Build`
- ./Build test # or `perl Build test`
- ./Build install # or `perl Build install`
-
-To install this module via ExtUtils::MakeMaker:
-
- perl Makefile.PL
- make
- make test
- make install
+ perl Makefile.PL
+ make
+ make test
+ make install
=head1 METHODS
=head2 variables( )
-Returns an array of variable names found in the template. NB: they
-are returned in random order.
+Returns an array of unique variable names found in the template.
+NB: they are returned in random order.
=cut
# fix undef vals
for my $var ( @vars ) {
$params{ $var } = defined $params{ $var }
- ? URI::Escape::uri_escape( $params{ $var } )
+ ? URI::Escape::uri_escape( $params{ $var }, $unsafe )
: '';
}
$uri =~ s/{(.+?)}/@params
? defined $params[ 0 ]
- ? URI::Escape::uri_escape( shift @params )
+ ? URI::Escape::uri_escape( shift @params, $unsafe )
: ''
: ''/eg;
=head1 AUTHOR
-=over 4
-
-=item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
-
-=back
+Brian Cassidy E<lt>bricas@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE