[Petal] Bug report
William McKee
william@knowmad.com
Thu, 15 Aug 2002 09:23:59 -0400
--Message-Boundary-2705
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
Hi Jean-Michel,
Another bug example for the string modifier is attached. Can you look at
this today and give me an idea of where to look to fix the problem? I've
compared the canonicalized code to the cached code. The canonicalized code
looks correct but it does not get correctly generated. I'm guessing the
Petal::Hash::String and friends get called from CodeGenerator. Is that
correct?
I looked at these modules last night and suspect the problem is with the
regex's. However, these regex's are a bit beyond my level of
understanding. If you could point me in the right direction, I'd be glad
to do some more debugging.
Thanks,
William
--
Lead Developer
Knowmad Services Inc. || Internet Applications & Database Integration
http://www.knowmad.com
--Message-Boundary-2705
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'test.cgi'
#!/usr/bin/perl
#
use strict;
use Petal;
use CGI::Carp qw/fatalsToBrowser/;
my $template_file = 'test.tmpl';
$Petal::DISK_CACHE = 0;
$Petal::MEMORY_CACHE = 0;
$Petal::TAINT = 1;
$Petal::BASE_DIR = './';
$Petal::INPUT = "HTML";
$Petal::OUTPUT = "XHTML";
my $template = new Petal ($template_file);
my $hash = {
error_message => "Kilroy was Here",
first_name => "William",
last_name => "McKee",
email => 'william@knowmad.com',
students => [ { student_id => '1',
first_name => 'William',
last_name => 'McKee',
email => 'william@knowmad.com',
},
{ student_id => '2',
first_name => 'Elizabeth',
last_name => 'McKee',
email => 'elizabeth@knowmad.com',
},
],
};
my $html = $template->process($hash);
print "Content-type: text/html\n\n";
print $html;
--Message-Boundary-2705
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.
---- File information -----------
File: test.tmpl
Date: 15 Aug 2002, 2:12
Size: 5229 bytes.
Type: Unknown
--Message-Boundary-2705
Content-type: Application/Octet-stream; name="test.tmpl"; type=Unknown
Content-disposition: attachment; filename="test.tmpl"
Content-transfer-encoding: BASE64
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLT8NCiMg
ICAgIFRlbXBsYXRlOiB0ZXN0LnRtcGwNCiMgICAgICBDcmVhdGVkOiAwNy0yMy0yMDAyDQoj
ICAgICBNb2RpZmllZDogMDgtMTQtMjAwMg0KIyAgICAgICBBdXRob3I6IHdsbQ0KIyAgRGVz
Y3JpcHRpb246IFRlbXBsYXRlIHRvIGRvIHRlcnJpYmxlIHRoaW5ncyB0byB0ZXN0IFBldGFs
IHRlbXBsYXRlIGxhbmd1YWdlLg0KLS0+DQo8IURPQ1RZUEUgaHRtbCBQVUJMSUMgIi0vL1cz
Qy8vRFREIFhIVE1MIDEuMCBUcmFuc2l0aW9uYWwvL0VOIg0KICAgICJodHRwOi8vd3d3Lncz
Lm9yZy9UUi94aHRtbDEvRFREL3hodG1sMS10cmFuc2l0aW9uYWwuZHRkIj4NCg0KPGh0bWwg
eG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPg0KICA8aGVhZD4NCiAgICA8
bWV0YSBuYW1lPSJnZW5lcmF0b3IiIGNvbnRlbnQ9IkhUTUwgVGlkeSBmb3IgV2luZG93cyAo
dmVycyAxc3QgSmFudWFyeSAyMDAyKSwgc2VlIHd3dy53My5vcmciIC8+DQoNCiAgICA8dGl0
bGU+UGV0YWwgU3RyZXNzIFRlc3QgVGVtcGxhdGU8L3RpdGxlPg0KICA8L2hlYWQ+DQogIDwh
LS0/IDw/cGV0YWw6aW5jbHVkZSBmaWxlPSJpbmNsdWRlcy9oZWFkZXIudG1wbCI/PiAtLT4N
Cg0KICA8Ym9keT4NCiAgICA8aDM+VGhlIHRhZ3M6PC9oMz4NCg0KICAgIDx1bD4NCiAgICAg
IDxsaT5lcnJvcl9tZXNzYWdlOiA8c3Bhb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