Because we're using Text::Template and we know it's a non core Perl module, we choose to bundle it into our source, for convenience. external/perl/Downloaded.txt document what modules we choose to bundle this way and exactly where we downloaded it from. With this changes comes the transfer module for with_fallback. Reviewed-by: Rich Salz <rsalz@openssl.org>master
parent
35c3a562c7
commit
8ff2af5483
@ -0,0 +1,13 @@
|
||||
Intro
|
||||
-----
|
||||
|
||||
If we find a useful Perl module that isn't one of the core Perl
|
||||
modules, we may choose to bundle it with the OpenSSL source.
|
||||
|
||||
Here, we simply list those modules and where we downloaded them from.
|
||||
|
||||
Downloaded and bundled Perl modules
|
||||
-----------------------------------
|
||||
|
||||
Text::Template 1.46 was downloaded from
|
||||
http://search.cpan.org/CPAN/authors/id/M/MJ/MJD/Text-Template-1.46.tar.gz
|
@ -0,0 +1,131 @@
|
||||
|
||||
|
||||
|
||||
|
||||
The "Artistic License"
|
||||
|
||||
Preamble
|
||||
|
||||
The intent of this document is to state the conditions under which a
|
||||
Package may be copied, such that the Copyright Holder maintains some
|
||||
semblance of artistic control over the development of the package,
|
||||
while giving the users of the package the right to use and distribute
|
||||
the Package in a more-or-less customary fashion, plus the right to make
|
||||
reasonable modifications.
|
||||
|
||||
Definitions:
|
||||
|
||||
"Package" refers to the collection of files distributed by the
|
||||
Copyright Holder, and derivatives of that collection of files
|
||||
created through textual modification.
|
||||
|
||||
"Standard Version" refers to such a Package if it has not been
|
||||
modified, or has been modified in accordance with the wishes
|
||||
of the Copyright Holder as specified below.
|
||||
|
||||
"Copyright Holder" is whoever is named in the copyright or
|
||||
copyrights for the package.
|
||||
|
||||
"You" is you, if you're thinking about copying or distributing
|
||||
this Package.
|
||||
|
||||
"Reasonable copying fee" is whatever you can justify on the
|
||||
basis of media cost, duplication charges, time of people involved,
|
||||
and so on. (You will not be required to justify it to the
|
||||
Copyright Holder, but only to the computing community at large
|
||||
as a market that must bear the fee.)
|
||||
|
||||
"Freely Available" means that no fee is charged for the item
|
||||
itself, though there may be fees involved in handling the item.
|
||||
It also means that recipients of the item may redistribute it
|
||||
under the same conditions they received it.
|
||||
|
||||
1. You may make and give away verbatim copies of the source form of the
|
||||
Standard Version of this Package without restriction, provided that you
|
||||
duplicate all of the original copyright notices and associated disclaimers.
|
||||
|
||||
2. You may apply bug fixes, portability fixes and other modifications
|
||||
derived from the Public Domain or from the Copyright Holder. A Package
|
||||
modified in such a way shall still be considered the Standard Version.
|
||||
|
||||
3. You may otherwise modify your copy of this Package in any way, provided
|
||||
that you insert a prominent notice in each changed file stating how and
|
||||
when you changed that file, and provided that you do at least ONE of the
|
||||
following:
|
||||
|
||||
a) place your modifications in the Public Domain or otherwise make them
|
||||
Freely Available, such as by posting said modifications to Usenet or
|
||||
an equivalent medium, or placing the modifications on a major archive
|
||||
site such as uunet.uu.net, or by allowing the Copyright Holder to include
|
||||
your modifications in the Standard Version of the Package.
|
||||
|
||||
b) use the modified Package only within your corporation or organization.
|
||||
|
||||
c) rename any non-standard executables so the names do not conflict
|
||||
with standard executables, which must also be provided, and provide
|
||||
a separate manual page for each non-standard executable that clearly
|
||||
documents how it differs from the Standard Version.
|
||||
|
||||
d) make other distribution arrangements with the Copyright Holder.
|
||||
|
||||
4. You may distribute the programs of this Package in object code or
|
||||
executable form, provided that you do at least ONE of the following:
|
||||
|
||||
a) distribute a Standard Version of the executables and library files,
|
||||
together with instructions (in the manual page or equivalent) on where
|
||||
to get the Standard Version.
|
||||
|
||||
b) accompany the distribution with the machine-readable source of
|
||||
the Package with your modifications.
|
||||
|
||||
c) give non-standard executables non-standard names, and clearly
|
||||
document the differences in manual pages (or equivalent), together
|
||||
with instructions on where to get the Standard Version.
|
||||
|
||||
d) make other distribution arrangements with the Copyright Holder.
|
||||
|
||||
5. You may charge a reasonable copying fee for any distribution of this
|
||||
Package. You may charge any fee you choose for support of this
|
||||
Package. You may not charge a fee for this Package itself. However,
|
||||
you may distribute this Package in aggregate with other (possibly
|
||||
commercial) programs as part of a larger (possibly commercial) software
|
||||
distribution provided that you do not advertise this Package as a
|
||||
product of your own. You may embed this Package's interpreter within
|
||||
an executable of yours (by linking); this shall be construed as a mere
|
||||
form of aggregation, provided that the complete Standard Version of the
|
||||
interpreter is so embedded.
|
||||
|
||||
6. The scripts and library files supplied as input to or produced as
|
||||
output from the programs of this Package do not automatically fall
|
||||
under the copyright of this Package, but belong to whoever generated
|
||||
them, and may be sold commercially, and may be aggregated with this
|
||||
Package. If such scripts or library files are aggregated with this
|
||||
Package via the so-called "undump" or "unexec" methods of producing a
|
||||
binary executable image, then distribution of such an image shall
|
||||
neither be construed as a distribution of this Package nor shall it
|
||||
fall under the restrictions of Paragraphs 3 and 4, provided that you do
|
||||
not represent such an executable image as a Standard Version of this
|
||||
Package.
|
||||
|
||||
7. C subroutines (or comparably compiled subroutines in other
|
||||
languages) supplied by you and linked into this Package in order to
|
||||
emulate subroutines and variables of the language defined by this
|
||||
Package shall not be considered part of this Package, but are the
|
||||
equivalent of input as in Paragraph 6, provided these subroutines do
|
||||
not change the language in any way that would cause it to fail the
|
||||
regression tests for the language.
|
||||
|
||||
8. Aggregation of this Package with a commercial distribution is always
|
||||
permitted provided that the use of this Package is embedded; that is,
|
||||
when no overt attempt is made to make this Package's interfaces visible
|
||||
to the end user of the commercial distribution. Such use shall not be
|
||||
construed as a distribution of this Package.
|
||||
|
||||
9. The name of the Copyright Holder may not be used to endorse or promote
|
||||
products derived from this software without specific prior written permission.
|
||||
|
||||
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
The End
|
@ -0,0 +1,31 @@
|
||||
|
||||
To install:
|
||||
|
||||
perl Makefile.PL
|
||||
|
||||
to construct the Makefile, then
|
||||
|
||||
make test
|
||||
|
||||
to test the package. If it fails any tests, please send me the output
|
||||
of `make test' and `perl -V'. I'll tell you whether it is safe to go
|
||||
ahead, or I'll provide a fix.
|
||||
|
||||
If it passes the tests, use
|
||||
|
||||
make install
|
||||
|
||||
to install it.
|
||||
|
||||
Detailed documentation is at the bottom of the lib/Text/Template.pm
|
||||
file. You may be able to view it with the following command:
|
||||
|
||||
perldoc Text::Template
|
||||
|
||||
Or:
|
||||
|
||||
perldoc lib/Text/Template.pm
|
||||
|
||||
If you have problems, send me mail:
|
||||
|
||||
mjd-perl-template+@plover.com
|
@ -0,0 +1,25 @@
|
||||
MANIFEST
|
||||
COPYING
|
||||
Artistic
|
||||
Makefile.PL
|
||||
INSTALL
|
||||
README
|
||||
lib/Text/Template.pm
|
||||
lib/Text/Template/Preprocess.pm
|
||||
t/00-version.t
|
||||
t/01-basic.t
|
||||
t/02-hash.t
|
||||
t/03-out.t
|
||||
t/04-safe.t
|
||||
t/05-safe2.t
|
||||
t/06-ofh.t
|
||||
t/07-safe3.t
|
||||
t/08-exported.t
|
||||
t/09-error.t
|
||||
t/10-delimiters.t
|
||||
t/11-prepend.t
|
||||
t/12-preprocess.t
|
||||
t/13-taint.t
|
||||
t/14-broken.t
|
||||
META.yml Module meta-data (added by MakeMaker)
|
||||
META.json Module JSON meta-data (added by MakeMaker)
|
@ -0,0 +1,39 @@
|
||||
{
|
||||
"abstract" : "unknown",
|
||||
"author" : [
|
||||
"unknown"
|
||||
],
|
||||
"dynamic_config" : 1,
|
||||
"generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120630",
|
||||
"license" : [
|
||||
"unknown"
|
||||
],
|
||||
"meta-spec" : {
|
||||
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
|
||||
"version" : "2"
|
||||
},
|
||||
"name" : "Text-Template",
|
||||
"no_index" : {
|
||||
"directory" : [
|
||||
"t",
|
||||
"inc"
|
||||
]
|
||||
},
|
||||
"prereqs" : {
|
||||
"build" : {
|
||||
"requires" : {
|
||||
"ExtUtils::MakeMaker" : "0"
|
||||
}
|
||||
},
|
||||
"configure" : {
|
||||
"requires" : {
|
||||
"ExtUtils::MakeMaker" : "0"
|
||||
}
|
||||
},
|
||||
"runtime" : {
|
||||
"requires" : {}
|
||||
}
|
||||
},
|
||||
"release_status" : "stable",
|
||||
"version" : "1.46"
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
---
|
||||
abstract: unknown
|
||||
author:
|
||||
- unknown
|
||||
build_requires:
|
||||
ExtUtils::MakeMaker: 0
|
||||
configure_requires:
|
||||
ExtUtils::MakeMaker: 0
|
||||
dynamic_config: 1
|
||||
generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120630'
|
||||
license: unknown
|
||||
meta-spec:
|
||||
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
||||
version: 1.4
|
||||
name: Text-Template
|
||||
no_index:
|
||||
directory:
|
||||
- t
|
||||
- inc
|
||||
requires: {}
|
||||
version: 1.46
|
@ -0,0 +1,7 @@
|
||||
use ExtUtils::MakeMaker;
|
||||
WriteMakefile(
|
||||
NAME => 'Text::Template',
|
||||
VERSION_FROM => 'lib/Text/Template.pm',
|
||||
# 'linkext' => {LINKTYPE => ''},
|
||||
'dist' => {COMPRESS => 'gzip', SUFFIX => 'gz'},
|
||||
);
|
@ -0,0 +1,339 @@
|
||||
|
||||
Text::Template v1.46
|
||||
|
||||
This is a library for generating form letters, building HTML pages, or
|
||||
filling in templates generally. A `template' is a piece of text that
|
||||
has little Perl programs embedded in it here and there. When you
|
||||
`fill in' a template, you evaluate the little programs and replace
|
||||
them with their values.
|
||||
|
||||
Here's an example of a template:
|
||||
|
||||
Dear {$title} {$lastname},
|
||||
|
||||
It has come to our attention that you are delinquent in your
|
||||
{$monthname[$last_paid_month]} payment. Please remit
|
||||
${sprintf("%.2f", $amount)} immediately, or your patellae may
|
||||
be needlessly endangered.
|
||||
|
||||
Love,
|
||||
|
||||
Mark "{nickname(rand 20)}" Dominus
|
||||
|
||||
|
||||
The result of filling in this template is a string, which might look
|
||||
something like this:
|
||||
|
||||
Dear Mr. Gates,
|
||||
|
||||
It has come to our attention that you are delinquent in your
|
||||
February payment. Please remit
|
||||
$392.12 immediately, or your patellae may
|
||||
be needlessly endangered.
|
||||
|
||||
|
||||
Love,
|
||||
|
||||
Mark "Vizopteryx" Dominus
|
||||
|
||||
You can store a template in a file outside your program. People can
|
||||
modify the template without modifying the program. You can separate
|
||||
the formatting details from the main code, and put the formatting
|
||||
parts of the program into the template. That prevents code bloat and
|
||||
encourages functional separation.
|
||||
|
||||
You can fill in the template in a `Safe' compartment. This means that
|
||||
if you don't trust the person who wrote the code in the template, you
|
||||
won't have to worry that they are tampering with your program when you
|
||||
execute it.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
Text::Template was originally released some time in late 1995 or early
|
||||
1996. After three years of study and investigation, I rewrote it from
|
||||
scratch in January 1999. The new version, 1.0, was much faster,
|
||||
delivered better functionality and was almost 100% backward-compatible
|
||||
with the previous beta versions.
|
||||
|
||||
I have added a number of useful features and conveniences since the
|
||||
1.0 release, while still retaining backward compatibility. With one
|
||||
merely cosmetic change, the current version of Text::Template passes
|
||||
the test suite that the old beta versions passed.
|
||||
|
||||
Questions or comments should be addressed to
|
||||
mjd-perl-template+@plover.com. This address goes directly to me, and
|
||||
not to anyone else; it is not a mailing list address.
|
||||
|
||||
To receive occasional announcements of new versions of T::T, send an
|
||||
empty note to mjd-perl-template-request@plover.com. This mailing list
|
||||
is not for discussion; it is for announcements only. Therefore, there
|
||||
is no address for sending messages to the list.
|
||||
|
||||
You can get the most recent version of Text::Template, news, comments,
|
||||
and other collateral information from
|
||||
<URL:http://www.plover.com/~mjd/perl/Template/>.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.46 since v1.44:
|
||||
|
||||
Thanks to Rik Signes, there is a new
|
||||
Text::Template->append_text_to_output method, which
|
||||
Text::Template always uses whenever it wants to emit output.
|
||||
You can subclass this to get control over the output, for
|
||||
example for postprocessing.
|
||||
|
||||
A spurious warning is no longer emitted when the TYPE
|
||||
parameter to ->new is omitted.
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.44 since v1.43:
|
||||
|
||||
This is a maintentance release. There are no feature changes.
|
||||
|
||||
_scrubpkg, which was responsible for eptying out temporary
|
||||
packages after the module had done with them, wasn't always
|
||||
working; the result was memory-leaks in long-running
|
||||
applications. This should be fixed now, and there is a test
|
||||
in the test suite for it.
|
||||
|
||||
Minor changes to the test suite to prevent spurious errors.
|
||||
|
||||
Minor documentation changes.
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.43 since v1.42:
|
||||
|
||||
The ->new method now fails immediately and sets
|
||||
$Text::Template::ERROR if the file that is named by a filename
|
||||
argument does not exist or cannot be opened for some other
|
||||
reason. Formerly, the constructor would succeed and the
|
||||
->fill_in call would fail.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.42 since v1.41:
|
||||
|
||||
This is a maintentance release. There are no feature changes.
|
||||
|
||||
Fixed a bug relating to use of UNTAINT under perl 5.005_03 and
|
||||
possibly other versions.
|
||||
|
||||
Taint-related tests are now more comprehensive.
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.41 since v1.40:
|
||||
|
||||
This is a maintentance release. There are no feature changes.
|
||||
|
||||
Tests now work correctly on Windows systems and possibly on
|
||||
other non-unix systems.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.40 since v1.31:
|
||||
|
||||
New UNTAINT option tells the module that it is safe to 'eval'
|
||||
code even though it has come from a file or filehandle.
|
||||
|
||||
Code added to prevent memory leaks when filling many
|
||||
templates. Thanks to Itamar Almeida de Carvalho.
|
||||
|
||||
Bug fix: $OUT was not correctly initialized when used in
|
||||
conjunction with SAFE.
|
||||
|
||||
You may now use a glob ref when passing a filehandle to the
|
||||
->new funcion. Formerly, a glob was reuqired.
|
||||
|
||||
New subclass: Text::Template::Preprocess. Just like
|
||||
Text::Template, but you may supply a PREPROCESS option in the
|
||||
constructor or the fill_in call; this is a function which
|
||||
receives each code fragment prior to evaluation, and which may
|
||||
modify and return the fragment; the modified fragment is what
|
||||
is evaluated.
|
||||
|
||||
Error messages passed to BROKEN subroutines will now report
|
||||
the correct line number of the template at which the error
|
||||
occurred:
|
||||
|
||||
Illegal division by zero at template line 37.
|
||||
|
||||
If the template comes from a file, the filename will be
|
||||
reported as well:
|
||||
|
||||
Illegal division by zero at catalog.tmpl line 37.
|
||||
|
||||
|
||||
INCOMPATIBLE CHANGE:
|
||||
|
||||
The format of the default error message has changed. It used
|
||||
to look like:
|
||||
|
||||
Program fragment at line 30 delivered error ``Illegal division by zero''
|
||||
|
||||
It now looks like:
|
||||
|
||||
Program fragment delivered error ``Illegal division by zero at catalog.tmpl line 37''
|
||||
|
||||
Note that the default message used to report the line number
|
||||
at which the program fragment began; it now reports the line
|
||||
number at which the error actually occurred.
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.31 since v1.23:
|
||||
|
||||
Just bug fixes---fill_in_string was failing. Thanks to
|
||||
Donald L. Greer Jr. for the test case.
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.23 since v1.22:
|
||||
|
||||
Small bug fix: DELIMITER and other arguments were being
|
||||
ignored in calls to fill_in_file and fill_this_in. (Thanks to
|
||||
Jonathan Roy for reporting this.)
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.22 since v1.20:
|
||||
|
||||
You can now specify that certain Perl statements be prepended
|
||||
to the beginning of every program fragment in a template,
|
||||
either per template, or for all templates, or for the duration
|
||||
of only one call to fill_in. This is useful, for example, if
|
||||
you want to enable `strict' checks in your templates but you
|
||||
don't want to manually add `use strict' to the front of every
|
||||
program fragment everywhere.
|
||||
|
||||
----------------------------------------------------------------
|
||||
What's new in v1.20 since v1.12:
|
||||
|
||||
You can now specify that the program fragment delimiters are
|
||||
strings other than { and }. This has three interesting
|
||||
effects: First, it changes the delimiter strings. Second, it
|
||||
disables the special meaning of \, so you have to be really,
|
||||
really sure that the delimiters will not appear in your
|
||||
templates. And third, because of the simplifications
|
||||
introduced by the elimination of \ processing, template
|
||||
parsing is 20-25% faster.
|
||||
|
||||
See the manual section on `Alternative Delimiters'.
|
||||
|
||||
Fixed bug having to do with undefined values in HASH options.
|
||||
In particular, Text::Template no longer generates a warning if
|
||||
you try to give a variable an undefined value.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.12 since v1.11:
|
||||
|
||||
I forgot to say that Text::Template ISA Exporter, so the
|
||||
exported functions never got exported. Duhhh!
|
||||
|
||||
Template TYPEs are now case-insensitive. The `new' method now
|
||||
diagnoses attempts to use an invalid TYPE.
|
||||
|
||||
More tests for these things.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.11 since v1.10:
|
||||
|
||||
Fixed a bug in the way backslashes were processed. The 1.10
|
||||
behavior was incompatible with the beta versions and was also
|
||||
inconvenient. (`\n' in templates was replaced with `n' before
|
||||
it was given to Perl for evaluation.) The new behavior is
|
||||
also incompatible with the beta versions, but it is only a
|
||||
little bit incompatible, and it is probbaly better.
|
||||
|
||||
Documentation for the new behavior, and tests for the bug.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.10 since v1.03:
|
||||
|
||||
New OUTPUT option delivers template results directly to a
|
||||
filehandle instead of making them into a string. Saves space
|
||||
and time.
|
||||
|
||||
PACKAGE and HASH now work intelligently with SAFE.
|
||||
|
||||
Fragments may now output data directly to the template, rather
|
||||
than having to arrange to return it as a return value at the
|
||||
end. This means that where you used to have to write this:
|
||||
|
||||
{ my $blist = '';
|
||||
foreach $i (@items) {
|
||||
$blist .= qq{ * $i\n};
|
||||
}
|
||||
$blist;
|
||||
}
|
||||
|
||||
You can now write this instead, because $OUT is special.
|
||||
|
||||
{ foreach $i (@items) {
|
||||
$OUT.= " * $i\n";
|
||||
}
|
||||
}
|
||||
|
||||
(`A spoonful of sugar makes the medicine go down.')
|
||||
|
||||
Fixed some small bugs. Worked around a bug in Perl that does
|
||||
the wrong thing with $x = <Y> when $x contains a glob.
|
||||
|
||||
More documentation. Errors fixed.
|
||||
|
||||
Lots more tests.
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in v1.03 since v1.0:
|
||||
|
||||
Code added to support HASH option to fill_in.
|
||||
(Incl. `_gensym' function.)
|
||||
|
||||
Documentation for HASH.
|
||||
|
||||
New test file for HASH.
|
||||
|
||||
Note about failure of lexical variables to propagate into
|
||||
templates. Why does this surprise people?
|
||||
|
||||
Bug fix: program fragments are evaluated in an environment with
|
||||
`no strict' by default. Otherwise, you get a lot of `Global
|
||||
symbol "$v" requires explicit package name' failures. Why didn't
|
||||
the test program pick this up? Because the only variable the test
|
||||
program ever used was `$a', which is exempt. Duhhhhh.
|
||||
|
||||
Fixed the test program.
|
||||
|
||||
Various minor documentation fixes.
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
Improvements of 1.0 over the old 0.1beta:
|
||||
|
||||
New features:
|
||||
|
||||
At least twice as fast
|
||||
|
||||
Better support for filling out the same template more than once
|
||||
|
||||
Now supports evaluation of program fragments in Safe
|
||||
compartments. (Thanks, Jonathan!)
|
||||
|
||||
Better argument syntax
|
||||
|
||||
More convenience functions
|
||||
|
||||
The parser is much better and simpler.
|
||||
|
||||
Once a template is parsed, the parsed version is stored so that
|
||||
it needn't be parsed again.
|
||||
|
||||
BROKEN function behavior is rationalized. You can now pass an
|
||||
arbitrary argument to your BROKEN function, or return a value
|
||||
from it to the main program.
|
||||
|
||||
Documentation overhauled.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,144 @@
|
||||
|
||||
package Text::Template::Preprocess;
|
||||
use Text::Template;
|
||||
@ISA = qw(Text::Template);
|
||||
$Text::Template::Preprocess::VERSION = 1.46;
|
||||
|
||||
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(@_);
|
||||
}
|
||||
|
||||
sub preprocessor {
|
||||
my ($self, $pp) = @_;
|
||||
my $old_pp = $self->{PREPROCESSOR};
|
||||
$self->{PREPROCESSOR} = $pp if @_ > 1; # OK to pass $pp=undef
|
||||
$old_pp;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Text::Template::Preprocess - Expand template text with embedded Perl
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
This file documents C<Text::Template::Preprocess> version B<1.46>
|
||||
|
||||
=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<Text::Template::Preprocess> provides a new C<PREPROCESSOR> option to
|
||||
C<fill_in>. If the C<PREPROCESSOR> option is supplied, it must be a
|
||||
reference to a preprocessor subroutine. When filling out a template,
|
||||
C<Text::Template::Preprocessor> 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<Text::Template::Preprocess> will then execute contents of C<$_> and
|
||||
insert the result into the appropriate part of the template.
|
||||
|
||||
C<Text::Template::Preprocess> objects also support a utility method,
|
||||
C<preprocessor()>, which sets a new preprocessor for the object. This
|
||||
preprocessor is used for all subsequent calls to C<fill_in> except
|
||||
where overridden by an explicit C<PREPROCESSOR> option.
|
||||
C<preprocessor()> returns the previous default preprocessor function,
|
||||
or undefined if there wasn't one. When invoked with no arguments,
|
||||
C<preprocessor()> returns the object's current default preprocessor
|
||||
function without changing it.
|
||||
|
||||
In all other respects, C<Text::Template::Preprocess> is identical to
|
||||
C<Text::Template>.
|
||||
|
||||
=head1 WHY?
|
||||
|
||||
One possible purpose: If your files contain a lot of JavaScript, like
|
||||
this:
|
||||
|
||||
|
||||
Plain text here...
|
||||
{ perl code }
|
||||
<script language=JavaScript>
|
||||
if (br== "n3") {
|
||||
// etc.
|
||||
}
|
||||
</script>
|
||||
{ more perl code }
|
||||
More plain text...
|
||||
|
||||
You don't want C<Text::Template> to confuse the curly braces in the
|
||||
JavaScript program with executable Perl code. One strategy:
|
||||
|
||||
sub quote_scripts {
|
||||
s(<script(.*?)</script>)(q{$1})gsi;
|
||||
}
|
||||
|
||||
Then use C<PREPROCESSOR =E<gt> \"e_scripts>. This will transform
|
||||
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<Text::Template>
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
|
||||
Mark Jason Dominus, Plover Systems
|
||||
|
||||
Please send questions and other remarks about this software to
|
||||
C<mjd-perl-template+@plover.com>
|
||||
|
||||
You can join a very low-volume (E<lt>10 messages per year) mailing
|
||||
list for announcements about this package. Send an empty note to
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
|
||||
=cut
|
||||
|
@ -0,0 +1,11 @@
|
||||
#!perl
|
||||
|
||||
use Text::Template;
|
||||
print "1..1\n";
|
||||
|
||||
if ($Text::Template::VERSION == 1.46) {
|
||||
print "ok 1\n";
|
||||
} else {
|
||||
print "not ok 1\n";
|
||||
}
|
||||
|
@ -0,0 +1,266 @@
|
||||
#!perl
|
||||
#
|
||||
# Tests of basic, essential functionality
|
||||
#
|
||||
|
||||
use Text::Template;
|
||||
$X::v = $Y::v = 0; # Suppress `var used only once'
|
||||
|
||||
print "1..31\n";
|
||||
|
||||
$n=1;
|
||||
|
||||
$template_1 = <<EOM;
|
||||
We will put value of \$v (which is "abc") here -> {\$v}
|
||||
We will evaluate 1+1 here -> {1 + 1}
|
||||
EOM
|
||||
|
||||
# (1) Construct temporary template file for testing
|
||||
# file operations
|
||||
$TEMPFILE = "tt$$";
|
||||
open(TMP, "> $TEMPFILE") or print "not ok $n\n" && &abort("Couldn\'t write tempfile $TEMPFILE: $!");
|
||||
print TMP $template_1;
|
||||
close TMP;
|
||||
print "ok $n\n"; $n++;
|
||||
|
||||
# (2) Build template from file
|
||||
$template = new Text::Template ('type' => 'FILE', 'source' => $TEMPFILE);
|
||||
if (defined($template)) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n $Text::Template::ERROR\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (3) Fill in template from file
|
||||
$X::v = "abc";
|
||||
$resultX = <<EOM;
|
||||
We will put value of \$v (which is "abc") here -> abc
|
||||
We will evaluate 1+1 here -> 2
|
||||
EOM
|
||||
$Y::v = "ABC";
|
||||
$resultY = <<EOM;
|
||||
We will put value of \$v (which is "abc") here -> ABC
|
||||
We will evaluate 1+1 here -> 2
|
||||
EOM
|
||||
|
||||
$text = $template->fill_in('package' => X);
|
||||
if ($text eq $resultX) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (4) Fill in same template again
|
||||
$text = $template->fill_in('package' => Y);
|
||||
if ($text eq $resultY) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
|
||||
|
||||
# (5) Simple test of `fill_this_in'
|
||||
$text = Text::Template->fill_this_in( $template_1, 'package' => X);
|
||||
if ($text eq $resultX) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (6) test creation of template from filehandle
|
||||
if (open (TMPL, "< $TEMPFILE")) {
|
||||
$template = new Text::Template ('type' => 'FILEHANDLE',
|
||||
'source' => *TMPL);
|
||||
if (defined($template)) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n $Text::Template::ERROR\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (7) test filling in of template from filehandle
|
||||
$text = $template->fill_in('package' => X);
|
||||
if ($text eq $resultX) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (8) test second fill_in on same template object
|
||||
$text = $template->fill_in('package' => Y);
|
||||
if ($text eq $resultY) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
close TMPL;
|
||||
} else {
|
||||
print "not ok $n\n"; $n++;
|
||||
print "not ok $n\n"; $n++;
|
||||
print "not ok $n\n"; $n++;
|
||||
}
|
||||
|
||||
|
||||
# (9) test creation of template from array
|
||||
$template = new Text::Template
|
||||
('type' => 'ARRAY',
|
||||
'source' => [
|
||||
'We will put value of $v (which is "abc") here -> {$v}',
|
||||
"\n",
|
||||
'We will evaluate 1+1 here -> {1+1}',
|
||||
"\n",
|
||||
]);
|
||||
if (defined($template)) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n $Text::Template::ERROR\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (10) test filling in of template from array
|
||||
$text = $template->fill_in('package' => X);
|
||||
if ($text eq $resultX) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (11) test second fill_in on same array template object
|
||||
$text = $template->fill_in('package' => Y);
|
||||
if ($text eq $resultY) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
print STDERR "$resultX\n---\n$text";
|
||||
unless (!defined($text)) { print STDERR "ERROR: $Text::Template::ERROR\n"};
|
||||
}
|
||||
$n++;
|
||||
|
||||
|
||||
|
||||
# (12) Make sure \ is working properly
|
||||
# Test added for version 1.11
|
||||
my $tmpl = Text::Template->new(TYPE => 'STRING',
|
||||
SOURCE => 'B{"\\}"}C{"\\{"}D',
|
||||
);
|
||||
# This should fail if the \ are not interpreted properly.
|
||||
my $text = $tmpl->fill_in();
|
||||
print +($text eq "B}C{D" ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (13) Make sure \ is working properly
|
||||
# Test added for version 1.11
|
||||
$tmpl = Text::Template->new(TYPE => 'STRING',
|
||||
SOURCE => qq{A{"\t"}B},
|
||||
);
|
||||
# Symptom of old problem: ALL \ were special in templates, so
|
||||
# The lexer would return (A, PROGTEXT("t"), B), and the
|
||||
# result text would be AtB instead of A(tab)B.
|
||||
$text = $tmpl->fill_in();
|
||||
|
||||
print +($text eq "A\tB" ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (14-27) Make sure \ is working properly
|
||||
# Test added for version 1.11
|
||||
# This is a sort of general test.
|
||||
my @tests = ('{""}' => '', # (14)
|
||||
'{"}"}' => undef, # (15)
|
||||
'{"\\}"}' => '}', # One backslash
|
||||
'{"\\\\}"}' => undef, # Two backslashes
|
||||
'{"\\\\\\}"}' => '}', # Three backslashes
|
||||
'{"\\\\\\\\}"}' => undef, # Four backslashes
|
||||
'{"\\\\\\\\\\}"}' => '\}', # Five backslashes (20)
|
||||
'{"x20"}' => 'x20',
|
||||
'{"\\x20"}' => ' ', # One backslash
|
||||
'{"\\\\x20"}' => '\\x20', # Two backslashes
|
||||
'{"\\\\\\x20"}' => '\\ ', # Three backslashes
|
||||
'{"\\\\\\\\x20"}' => '\\\\x20', # Four backslashes (25)
|
||||
'{"\\\\\\\\\\x20"}' => '\\\\ ', # Five backslashes
|
||||
'{"\\x20\\}"}' => ' }', # (27)
|
||||
);
|
||||
|
||||
my $i;
|
||||
for ($i=0; $i<@tests; $i+=2) {
|
||||
my $tmpl = Text::Template->new(TYPE => 'STRING',
|
||||
SOURCE => $tests[$i],
|
||||
);
|
||||
my $text = $tmpl->fill_in;
|
||||
my $result = $tests[$i+1];
|
||||
my $ok = (! defined $text && ! defined $result
|
||||
|| $text eq $result);
|
||||
unless ($ok) {
|
||||
print STDERR "($n) expected .$result., got .$text.\n";
|
||||
}
|
||||
print +($ok ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
}
|
||||
|
||||
|
||||
# (28-30) I discovered that you can't pass a glob ref as your filehandle.
|
||||
# MJD 20010827
|
||||
# (28) test creation of template from filehandle
|
||||
if (open (TMPL, "< $TEMPFILE")) {
|
||||
$template = new Text::Template ('type' => 'FILEHANDLE',
|
||||
'source' => \*TMPL);
|
||||
if (defined($template)) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n $Text::Template::ERROR\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (29) test filling in of template from filehandle
|
||||
$text = $template->fill_in('package' => X);
|
||||
if ($text eq $resultX) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
# (30) test second fill_in on same template object
|
||||
$text = $template->fill_in('package' => Y);
|
||||
if ($text eq $resultY) {
|
||||
print "ok $n\n";
|
||||
} else {
|
||||
print "not ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
close TMPL;
|
||||
} else {
|
||||
print "not ok $n\n"; $n++;
|
||||
print "not ok $n\n"; $n++;
|
||||
print "not ok $n\n"; $n++;
|
||||
}
|
||||
|
||||
# (31) Test _scrubpkg for leakiness
|
||||
$Text::Template::GEN0::test = 1;
|
||||
Text::Template::_scrubpkg('Text::Template::GEN0');
|
||||
if ($Text::Template::GEN0::test) {
|
||||
print "not ok $n\n";
|
||||
} else {
|
||||
print "ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
|
||||
|
||||
END {unlink $TEMPFILE;}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
sub abort {
|
||||
unlink $TEMPFILE;
|
||||
die $_[0];
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
#!perl
|
||||
#
|
||||
# test apparatus for Text::Template module
|
||||
# still incomplete.
|
||||
|
||||
use Text::Template;
|
||||
|
||||
die "This is the test program for Text::Template version 1.46.
|
||||
You are using version $Text::Template::VERSION instead.
|
||||
That does not make sense.\n
|
||||
Aborting"
|
||||
unless $Text::Template::VERSION == 1.46;
|
||||
|
||||
|
||||
print "1..12\n";
|
||||
|
||||
$n=1;
|
||||
|
||||
$template = 'We will put value of $v (which is "good") here -> {$v}';
|
||||
|
||||
$v = 'oops (main)';
|
||||
$Q::v = 'oops (Q)';
|
||||
|
||||
$vars = { 'v' => \'good' };
|
||||
|
||||
# (1) Build template from string
|
||||
$template = new Text::Template ('type' => 'STRING', 'source' => $template);
|
||||
print +($template ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (2) Fill in template in anonymous package
|
||||
$result2 = 'We will put value of $v (which is "good") here -> good';
|
||||
$text = $template->fill_in(HASH => $vars);
|
||||
print +($text eq $result2 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (3) Did we clobber the main variable?
|
||||
print +($v eq 'oops (main)' ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (4) Fill in same template again
|
||||
$result4 = 'We will put value of $v (which is "good") here -> good';
|
||||
$text = $template->fill_in(HASH => $vars);
|
||||
print +($text eq $result4 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (5) Now with a package
|
||||
$result5 = 'We will put value of $v (which is "good") here -> good';
|
||||
$text = $template->fill_in(HASH => $vars, PACKAGE => 'Q');
|
||||
print +($text eq $result5 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (6) We expect to have clobbered the Q variable.
|
||||
print +($Q::v eq 'good' ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (7) Now let's try it without a package
|
||||
$result7 = 'We will put value of $v (which is "good") here -> good';
|
||||
$text = $template->fill_in(HASH => $vars);
|
||||
print +($text eq $result7 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (8-11) Now what does it do when we pass a hash with undefined values?
|
||||
# Roy says it does something bad. (Added for 1.20.)
|
||||
my $WARNINGS = 0;
|
||||
{
|
||||
local $SIG{__WARN__} = sub {$WARNINGS++};
|
||||
local $^W = 1; # Make sure this is on for this test
|
||||
$template8 = 'We will put value of $v (which is "good") here -> {defined $v ? "bad" : "good"}';
|
||||
$result8 = 'We will put value of $v (which is "good") here -> good';
|
||||
my $template =
|
||||
new Text::Template ('type' => 'STRING', 'source' => $template8);
|
||||
my $text = $template->fill_in(HASH => {'v' => undef});
|
||||
# (8) Did we generate a warning?
|
||||
print +($WARNINGS == 0 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (9) Was the output correct?
|
||||
print +($text eq $result8 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (10-11) Let's try that again, with a twist this time
|
||||
$WARNINGS = 0;
|
||||
$text = $template->fill_in(HASH => [{'v' => 17}, {'v' => undef}]);
|
||||
# (10) Did we generate a warning?
|
||||
print +($WARNINGS == 0 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# (11) Was the output correct?
|
||||
if ($] < 5.005) {
|
||||
print "ok $n # skipped -- not supported before 5.005\n";
|
||||
} else {
|
||||
print +($text eq $result8 ? '' : 'not '), "ok $n\n";
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
|
||||
|
||||
# (12) Now we'll test the multiple-hash option (Added for 1.20.)
|
||||
$text = Text::Template::fill_in_string(q{$v: {$v}. @v: [{"@v"}].},
|
||||
HASH => [{'v' => 17},
|
||||
{'v' => ['a', 'b', 'c']},
|
||||
{'v' => \23},
|
||||
]);
|
||||
$result = q{$v: 23. @v: [a b c].};
|
||||
print +($text eq $result ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
|
||||
exit;
|
||||
|
@ -0,0 +1,56 @@
|
||||
#!perl
|
||||
#
|
||||
# test apparatus for Text::Template module
|
||||
# still incomplete.
|
||||
#
|
||||
|
||||
use Text::Template;
|
||||
|
||||
die "This is the test program for Text::Template version 1.46
|
||||
You are using version $Text::Template::VERSION instead.
|
||||
That does not make sense.\n
|
||||
Aborting"
|
||||
unless $Text::Template::VERSION == 1.46;
|
||||
|
||||
print "1..1\n";
|
||||
|
||||
$n=1;
|
||||
|
||||
$template = q{
|
||||
This line should have a 3: {1+2}
|
||||
|
||||
This line should have several numbers:
|
||||
{ $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
|
||||
};
|
||||
|
||||
$templateOUT = q{
|
||||
This line should have a 3: { $OUT = 1+2 }
|
||||
|
||||
This line should have several numbers:
|
||||
{ foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
|
||||
};
|
||||
|
||||
# Build templates from string
|
||||
$template = new Text::Template ('type' => 'STRING', 'source' => $template)
|
||||
or die;
|
||||
$templateOUT = new Text::Template ('type' => 'STRING', 'source' => $templateOUT)
|
||||
or die;
|
||||
|
||||
# Fill in templates
|
||||
$text = $template->fill_in()
|
||||
or die;
|
||||
$textOUT = $templateOUT->fill_in()
|
||||
or die;
|
||||
|
||||
# (1) They should be the same
|
||||
print +($text eq $textOUT ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
|
||||
# Missing: Test this feature in Safe compartments;
|
||||
# it's a totally different code path.
|
||||
# Decision: Put that into safe.t, because that file should
|
||||
# be skipped when Safe.pm is unavailable.
|
||||
|
||||
|
||||
exit;
|
||||
|
@ -0,0 +1,161 @@
|
||||
#!perl
|
||||
#
|
||||
# test apparatus for Text::Template module
|
||||
# still incomplete.
|
||||
|
||||
use Text::Template;
|
||||
|
||||
BEGIN {
|
||||
eval "use Safe";
|
||||
if ($@) {
|
||||
print "1..0\n";
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
||||
die "This is the test program for Text::Template version 1.46.
|
||||
You are using version $Text::Template::VERSION instead.
|
||||
That does not make sense.\n
|
||||
Aborting"
|
||||
unless $Text::Template::VERSION == 1.46;
|
||||
|
||||
print "1..16\n";
|
||||
|
||||
if ($^O eq 'MacOS') {
|
||||
$BADOP = qq{};
|
||||
$FAILURE = q{};
|
||||
} else {
|
||||
$BADOP = qq{kill 0};
|
||||
$FAILURE = q{Program fragment at line 1 delivered error ``kill trapped by operation mask''};
|
||||
}
|
||||
|
||||
$n=1;
|
||||
$v = $v = 119;
|
||||
|
||||
$c = new Safe or die;
|
||||
|
||||
$goodtemplate = q{This should succeed: { $v }};
|
||||
$goodoutput = q{This should succeed: 119};
|
||||
|
||||
$template1 = new Text::Template ('type' => 'STRING', 'source' => $goodtemplate)
|
||||
or die;
|
||||
$template2 = new Text::Template ('type' => 'STRING', 'source' => $goodtemplate)
|
||||
or die;
|
||||
|
||||
$text1 = $template1->fill_in();
|
||||
$text2 = $template1->fill_in(SAFE => $c);
|
||||
$ERR2 = $@;
|
||||
$text3 = $template2->fill_in(SAFE => $c);
|
||||
$ERR3 = $@;
|
||||
|
||||
# (1)(2)(3) None of these should have failed.
|
||||
print +(defined $text1 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
print +(defined $text2 ? '' : 'not '), "ok $n\n";
|
||||
$n++;
|
||||
print +(defined $text3 ? '' : 'not '), "ok $n\n";
|
||||