=item There are no references.
-There was in initial beta tests, but it was decided to remove the little used feature.
-
-It makes it the same as
-
- [% obj.method("foo") %]
-
-This is removed in CET.
+There were in initial beta tests, but it was decided to remove the little used feature which
+took a length of code to implement.
=item The DEBUG directive is more limited.
=item There is no ANYCASE configuration item.
-There was in initial beta tests, but it was dropped in favor of consistent parsing syntax.
+There was in initial beta tests, but it was dropped in favor of consistent parsing syntax (and
+a minimal amount of speedup).
=item There is no V1DOLLAR configuration item.
=item '0'
- [% item = 'foo' %][% item.0 %] Returns self. Allows for scalars to mask as arrays.
+ [% item = 'foo' %][% item.0 %] Returns self. Allows for scalars to mask as arrays (scalars
+ already will, but this allows for more direct access).
=item as
=item format
- [% item.format('%d') %] Print the string out in the specified format. Each line is
+ [% item.format('%d') %] Print the string out in the specified format. It is similar to
+ the "as" virtual method, except that the item is split on newline and each line is
processed separately.
=item hash
=item remove
- [% item.remove("\s+") %] Same as remove - but is global and replaces with nothing.
+ [% item.remove("\s+") %] Same as replace - but is global and replaces with nothing.
=item redirect
[% item.replace("\s+", " ") %] Globally replace all space with
- [% item.replace("foo", "bar", 0) Replace only the first instance of foo with bar.
+ [% item.replace("foo", "bar", 0) %] Replace only the first instance of foo with bar.
[% item.replace("(\w+)", "($1)") %] Surround all words with parenthesis.
=item search
- [% item.search("(\w+)" %] Tests if the given pattern is in the string.
+ [% item.search("(\w+)") %] Tests if the given pattern is in the string.
=item size
Hello.
- [%- "Hi." -%]
+ [%= "Hi." =%]
Howdy.
Hello.
- [%- "Hi." -%]
+ [%~ "Hi." ~%]
Howdy.
my $str = q{
[% a = "Hello" %]
- 1([% a | filter1 %])
- 2([% a | filter2 %])
- 3([% a | filter3 %])
+ 1 ([% a | filter1 %])
+ 2 ([% a | filter2 %])
+ 3 ([% a | filter3 %])
};
my $obj = CGI::Ex::Template->new(FILTERS => $filters);
Would print:
- (11111)
- (22222)
- (33333)
+ 1 (11111)
+ 2 (22222)
+ 3 (33333)
Filters passed in as an arrayref should contain a coderef and a value
indicating if they are dynamic or static (true meaning dynamic). The