use strict;
use warnings;
-our $VERSION = '0.08_01';
+our $VERSION = '0.10';
use URI;
use URI::Escape ();
=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
sub process_to_string {
my $self = shift;
- if( ref $_[ 0 ] ) {
+ if ( ref $_[ 0 ] ) {
return $self->_process_by_position( @_ );
}
else {
# fix undef vals
for my $var ( @vars ) {
- $params{ $var } = defined $params{ $var }
+ $params{ $var }
+ = defined $params{ $var }
? URI::Escape::uri_escape( $params{ $var }, $unsafe )
: '';
}
my $self = shift;
my $uri = shift;
- if( !$self->{ deparse_re } ) {
- my $templ = $self->as_string;
- $self->{ vars_list } = [ $templ =~ /{(.+?)}/g ];
- $templ =~ s/{.+?}/(.+?)/g;
- $self->{ deparse_re } = qr/$templ/;
+ if ( !$self->{ deparse_re } ) {
+ my $templ = $self->as_string;
+ $self->{ vars_list } = [ $templ =~ /{(.+?)}/g ];
+ $templ =~ s/{.+?}/(.+?)/g;
+ $self->{ deparse_re } = qr/$templ/;
}
my @matches = $uri =~ $self->{ deparse_re };
=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