Using '|' in TALES

"Lenga, Yair [CIB-FI]" <[email protected]> Sun, 13 Aug 2006 17:00:05 -0400
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
Hi,

I'm trying to use Petal for a new project that I'm working on.

I tried to use the '|' (alternative value), based on the TALES =
documentation. I realized this is not listed in the Petal doc, but I =
tought to give it a try.

When I tried:

<html>
<body>
<p petal:content=3D"my/data | string:nothing" > Someting </p>
</body>
</html>

perl -Mpetal -e 'print new Petal(file=3D>"file.html", =
error_on_undef_value =3D> 0)->process();"

I was getting an error (undef value). When I allowed the error =
(error_on_undef_var =3D 0), I got empty tag - I was hoping to see =
"nothing").

I decided to try this without the spaces, same command.

<html>
<body>
<p petal:content=3D"my/data|string:nothing" > Someting </p>
</body>
</html>

What I got was infinite recursion. The program was producing:
Deep recursion on subroutine "Petal::Hash::fetch" at =
blib/lib/Petal/Hash/Var.pm line 73.
Deep recursion on subroutine "Petal::Hash::Var::process" at =
blib/lib/Petal/Hash.pm line 188.

and then the program started hitting the disk - asking for more and more =
memory (the disk activity was probably from swaping). After few seconds, =
the whoe server could not function.

Few questions:
- Is the '|' suppose to work with TAL ? what is the correct syntax.
- Any chance of fixing the bug ? My pages are designed by a designer - =
My goal with Petal is to limit his ability to impact server performance.