[Petal] Petal::CodePerl doesn't seem to work

Jonathan Vanasco jvanasco at mastersofbranding.com
Fri Aug 19 05:20:52 BST 2005


Problem:
I can't seem to get Petal::CodePerl to work

Explanation:

(happens with both
   use Petal::CodePerl;
  and
   use Petal;
   $Petal::CodeGenerator = 'Petal::CodePerl::CodeGenerator'\
)

Part 1:

   If I include a condition which works fine in Petal without CodePerl,
     <span tal:condition="true: RS_ShowMe">show me</span>

   Petal sadly tells me:
Undefined subroutine &Petal::XML_Encode_Decode::encode called at  
(eval 20) line 11.

I can't find anything that would suggest the syntax is change for if  
statements.  Removing the if statement, petal::codeperl parses things  
fine.


Part 2

To make things worse, if I were  to look at the debug in /tmp ...
      $res .= do {
         my $res = $hash->get_encoded ('RS_CoreElement');
         (defined $res) ? $res : "";
     };

Based on the codeperl documentation, i believe that should be seeing:
     $res .= do {
         my $res = $hash{'RS_CoreElement'};
         (defined $res) ? $res : "";
     };


Can anyone suggest help?

Platform:
   mac osx 10.4
   perl 5.8.6




More information about the Petal mailing list