⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Text
/
Template
/
Edit File: Preprocess.pm
package Text::Template::Preprocess; $Text::Template::Preprocess::VERSION = '1.51'; # ABSTRACT: Expand template text with embedded Perl use strict; use warnings; use Text::Template; our @ISA = qw(Text::Template); sub 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; } 1; __END__ =pod =head1 NAME Text::Template::Preprocess - Expand template text with embedded Perl =head1 VERSION version 1.51 =head1 SYNOPSIS use Text::Template::Preprocess; my $t = Text::Template::Preprocess->new(...); # identical to Text::Template # Fill in template, but preprocess each code fragment with pp(). my $result = $t->fill_in(..., PREPROCESSOR => \&pp); my $old_pp = $t->preprocessor(\&new_pp); =head1 DESCRIPTION C
provides a new C
option to C
. If the C
option is supplied, it must be a reference to a preprocessor subroutine. When filling out a template, C
will use this subroutine to preprocess the program fragment prior to evaluating the code. The preprocessor subroutine will be called repeatedly, once for each program fragment. The program fragment will be in C<$_>. The subroutine should modify the contents of C<$_> and return. C
will then execute contents of C<$_> and insert the result into the appropriate part of the template. C
objects also support a utility method, C
, which sets a new preprocessor for the object. This preprocessor is used for all subsequent calls to C
except where overridden by an explicit C
option. C
returns the previous default preprocessor function, or undefined if there wasn't one. When invoked with no arguments, C
returns the object's current default preprocessor function without changing it. In all other respects, C
is identical to C
. =head1 WHY? One possible purpose: If your files contain a lot of JavaScript, like this: Plain text here... { perl code } { more perl code } More plain text... You don't want C
to confuse the curly braces in the JavaScript program with executable Perl code. One strategy: sub quote_scripts { s(