On Friday 31 May 2002 10:54, you wrote:
> The following code causes a seg fault for me:
>
> use Template;
> my $tt = Template->new({ EVAL_PERL => 1});
> my $script = '[% PERL %] print $$ [% END %]';
> $tt->process(\$script) or die $tt->error;
>
On a lark I converted this to a one-liner and ran it thru the perl debugger
on my end. Even stepping thru with 'n', I still SEGV'd, but this time I
received information that might help in locating the problem:
perl -d -MTemplate -le '$tt=Template->new({EVAL_PERL=>1}); my $s="[% PERL
%]print \$\$[% END %]"; $tt->process(\$s) or die $tt->error'
<type n 3 or so times>
And I get this:
"Signal SEGV at (eval 4)[/usr/local/lib/perl/5.6.1/Template/Document.pm:68]
line 7
Template::Document::__ANON__[(eval
4)[/usr/local/lib/perl/5.6.1/Template/Document.pm:68]:38]('Template::Context=HASH(0x846c0f0)')
called at /usr/local/lib/perl/5.6.1/Template/Document.pm line 142
eval {...} called at /usr/local/lib/perl/5.6.1/Template/Document.pm
line 140
Template::Document::process('Template::Document=HASH(0x8674d9c)',
'Template::Context=HASH(0x846c0f0)') called at
/usr/local/lib/perl/5.6.1/Template/Context.pm line 283
Template::Context::process('Template::Context=HASH(0x846c0f0)',
'Template::Document=HASH(0x8674d9c)') called at
/usr/local/lib/perl/5.6.1/Template/Service.pm line 90
eval {...} called at /usr/local/lib/perl/5.6.1/Template/Service.pm
line 88
Template::Service::process('Template::Service=HASH(0x83d326c)',
'SCALAR(0x80ffb9c)', undef) called at /usr/local/lib/perl/5.6.1/Template.pm
line 59
Template::process('Template=HASH(0x83d54c8)', 'SCALAR(0x80ffb9c)')
called at -e line 1
Aborted"
Hope this helps.
- Cliff Wood
- Programmer/Analyst/Editor, OSDN