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;
Any of the following lines inside the [% PERL %] section also cause a
core dump:
print $_
print $@
print $!
print @_
print %SIG
s/(.)/$1/
sort { $a <=> $b } (1..10)
These all seem to be related to the perl builtin special variables.
Additionally, anything which should gracefully produce a "Global
symbol '...' requires explicit package name..." error (since a [%
PERL %] block seems to run under "use strict"), also gives me a seg
fault. (Something like "print $x", for example, will trigger this.)
Is anyone else having this problem? Any suggestions on how to fix it?
Also notable:
- in a RAWPERL rather than a PERL section, any of these work as expected
- when I run under the perl debugger and step through the main program
using "n", the exact same code that would seg fault works fine
- when I run under the perl debugger and hit "c" to run all at once, it
dumps core
I am running Template toolkit 2.07 (had the same problem under 2.06,
too) with perl 5.6.1 on Linux. I have the exact same problems (except
it's a bus error rather than a seg fault) on Solaris (template toolkit
version 2.05 and perl 5.6.1).
Thanks for any help.
- Kevin
--
Kevin Eye
Web Applications Developer
Creative Services and Marketing
University at Buffalo
330 Crofts Hall
Buffalo, NY 14260
[EMAIL PROTECTED]
phone (716) 645-5000 x1435
fax (716) 645-3765