Hi again list,
Whilst bashing my head against this silly problem. I've discovered more
cases of it working and not.
[% PERL %]
my ( $x, $y ) = ( 500, 200 );
^^
$stash->set( 'x', $x );
$stash->set( 'y', $y );
[% END %]
...works. But:
[% PERL %]
use vars qw( $x $y );
( $x, $y ) = ...
[% END %]
...does not. Similarly, if I neither 'my' them, or 'use vars qw' then it
also crashes.
Whilst I think I've discovered enough to get my templates working again
under 2.06, I think some code is barfing in a rather unfriendly manner.
Just forgetting to 'my' some variables results in a segfault rather than a
more helpful message about an undeclared variable, etc.
When I trace the ttree process, it barfs as follows, (apologies for bad
wrapping) on this simple template:
[% PERL %]
use vars qw( $x $y );
( $x, $y ) = ( 500, 200 );
$stash->set( 'x', $x );
$stash->set( 'y', $y );
[% END %]
root@mould:/home/vhosts/uf/src# perl -d /usr/bin/ttree -s ./ -d /tmp
--eval_perl foo.html
Default die handler restored.
Loading DB routines from perl5db.pl version 1.07
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(/usr/bin/ttree:3): eval 'exec /usr/bin/perl -w -S $0
${1+"$@"}'
main::(/usr/bin/ttree:4): if 0; # not running under some shell
DB<1> r
Do you want me to create a sample '.ttreerc' file for you?
(file: /root/.ttreerc) [y/n]: n
Signal SEGV at (eval
10)[/usr/lib/perl5/site_perl/5.6.1/Template/Document.pm:68] line 7
Template::Document::__ANON__[(eval
10)[/usr/lib/perl5/site_perl/5.6.1/Template/Document.pm:68]:39]('Template::Context=HASH(0x852f0c0)')
called
at /usr/lib/perl5/site_perl/5.6.1/Template/Document.pm line 142
eval {...} called at
/usr/lib/perl5/site_perl/5.6.1/Template/Document.pm line 140
Template::Document::process('Template::Document=HASH(0x85be420)',
'Template::Context=HASH(0x852f0c0)') called at
/usr/lib/perl5/site_perl/5.6.1/Template/Context.pm line 298
Template::Context::process('Template::Context=HASH(0x852f0c0)',
'Template::Document=HASH(0x85be420)') called at
/usr/lib/perl5/site_perl/5.6.1/Template/Service.pm line 90
eval {...} called at
/usr/lib/perl5/site_perl/5.6.1/Template/Service.pm
line 88
Template::Service::process('Template::Service=HASH(0x84fa3b4)',
'foo.html', 'HASH(0x84eb1ac)') called at
/usr/lib/perl5/site_perl/5.6.1/Template.pm line 59
Template::process('Template=HASH(0x84f8bb0)', 'foo.html',
'HASH(0x84eb1ac)', 'foo.html') called at /usr/bin/ttree line 153
Aborted
Whilst the above may not be helpful, if someone wants to tell me what I
*should* do, I'll gladly do it, or does this code not crash on anyone
elses setup?
Is this perhaps a 'feature' of the code that evaluates the embedded Perl
code? :-)
Cheers
Matt
--
"Phase plasma rifle in a forty-watt range?"
"Only what you see on the shelves, buddy."