Update the bundled external perl module Text-Template to version 1.56
[openssl.git] / external / perl / Text-Template-1.56 / lib / Text / Template / Preprocess.pm
similarity index 64%
rename from external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm
rename to external/perl/Text-Template-1.56/lib/Text/Template/Preprocess.pm
index 1e41037bd362242dc22330908902c537dd539209..4fea67b383130da442ff248cdcba920e4aa5594e 100644 (file)
@@ -1,40 +1,59 @@
 
 package Text::Template::Preprocess;
+$Text::Template::Preprocess::VERSION = '1.56';
+# ABSTRACT: Expand template text with embedded Perl
+
+use strict;
+use warnings;
+
 use Text::Template;
-@ISA = qw(Text::Template);
-$Text::Template::Preprocess::VERSION = 1.46;
+our @ISA = qw(Text::Template);
 
 sub fill_in {
-  my $self = shift;
-  my (%args) = @_;
-  my $pp = $args{PREPROCESSOR} || $self->{PREPROCESSOR} ;
-  if ($pp) {
-    local $_ = $self->source();
-#    print "# fill_in: before <$_>\n";
-    &$pp;
-#    print "# fill_in: after <$_>\n";
-    $self->set_source_data($_);
-  }
-  $self->SUPER::fill_in(@_);
+    my $self   = shift;
+    my (%args) = @_;
+
+    my $pp     = $args{PREPROCESSOR} || $self->{PREPROCESSOR};
+
+    if ($pp) {
+        local $_ = $self->source();
+        my $type = $self->{TYPE};
+
+        #    print "# fill_in: before <$_>\n";
+        &$pp;
+
+        #    print "# fill_in: after <$_>\n";
+        $self->set_source_data($_, $type);
+    }
+
+    $self->SUPER::fill_in(@_);
 }
 
 sub preprocessor {
-  my ($self, $pp) = @_;
-  my $old_pp = $self->{PREPROCESSOR};
-  $self->{PREPROCESSOR} = $pp if @_ > 1;  # OK to pass $pp=undef
-  $old_pp;
+    my ($self, $pp) = @_;
+
+    my $old_pp = $self->{PREPROCESSOR};
+
+    $self->{PREPROCESSOR} = $pp if @_ > 1;    # OK to pass $pp=undef
+
+    $old_pp;
 }
 
 1;
 
+__END__
 
-=head1 NAME 
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
 
 Text::Template::Preprocess - Expand template text with embedded Perl
 
 =head1 VERSION
 
-This file documents C<Text::Template::Preprocess> version B<1.46>
+version 1.56
 
 =head1 SYNOPSIS
 
@@ -78,7 +97,6 @@ C<Text::Template>.
 One possible purpose:  If your files contain a lot of JavaScript, like
 this:
 
-
         Plain text here...
         { perl code }
         <script language=JavaScript>
@@ -98,14 +116,25 @@ JavaScript program with executable Perl code.  One strategy:
 
 Then use C<PREPROCESSOR =E<gt> \&quote_scripts>.  This will transform 
 
-
-
 =head1 SEE ALSO
 
 L<Text::Template>
 
-=head1 AUTHOR
+=head1 SOURCE
+
+The development version is on github at L<https://https://github.com/mschout/perl-text-template>
+and may be cloned from L<git://https://github.com/mschout/perl-text-template.git>
+
+=head1 BUGS
+
+Please report any bugs or feature requests on the bugtracker website
+L<https://github.com/mschout/perl-text-template/issues>
 
+When submitting a bug or request, please include a test-file or a
+patch to an existing test-file that illustrates the bug or desired
+feature.
+
+=head1 AUTHOR
 
 Mark Jason Dominus, Plover Systems
 
@@ -118,27 +147,11 @@ C<mjd-perl-template-request@plover.com> to join.
 
 For updates, visit C<http://www.plover.com/~mjd/perl/Template/>.
 
-=head1 LICENSE
-
-    Text::Template::Preprocess version 1.46
-    Copyright 2013 Mark Jason Dominus
+=head1 COPYRIGHT AND LICENSE
 
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License as
-    published by the Free Software Foundation; either version 2 of the
-    License, or (at your option) any later version.  You may also can
-    redistribute it and/or modify it under the terms of the Perl
-    Artistic License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received copies of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+This software is copyright (c) 2013 by Mark Jason Dominus <mjd@cpan.org>.
 
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
 
 =cut
-