Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 17640
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: cpanbugs [...] tim.hinchcliffe.peerex.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.14
Fixed in: (no value)



Subject: Undefined subroutine &Template::Plugin::File::getpwuid called at /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/Template/Plugin/File.pm line 104.
If you redefine $SIG{__DIE__} and USE file = File("filename") you get the following error: Undefined subroutine &Template::Plugin::File::getpwuid called at /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/Template/Plugin/File.pm line 104. To see this error, add: $SIG{__DIE__} = sub { warn @_; exit 255 }; to the top of tpage and run a template containing '[% USE file = File(template.name) %]' Although this is a bad __DIE__ handler, it is detecting an error which would normally just get ignored but is still present. Attached is a modified tpage, and an example template.
Subject: demo.tt2
Download demo.tt2
application/octet-stream 37b

Message body not shown because it is not plain text.

Subject: tpage
Download tpage
application/octet-stream 7.9k

Message body not shown because it is not plain text.

On Tue Feb 14 07:44:56 2006, guest wrote: Show quoted text
> Undefined subroutine &Template::Plugin::File::getpwuid called at > /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread- > multi/Template/Plugin/File.pm > line 104.
Yes, that's unfortunate, but it's expected behaviour. The documentation states that they may not be defined on your system and the calls will return undef. You're seeing the error raised by the eval { } that we wrap the calls in.
On 2008-08-06 09:25:14, ABW wrote: Show quoted text
> On Tue Feb 14 07:44:56 2006, guest wrote:
> > Undefined subroutine &Template::Plugin::File::getpwuid called at > > /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread- > > multi/Template/Plugin/File.pm > > line 104.
> > Yes, that's unfortunate, but it's expected behaviour. The documentation > states that they may not be defined on your system and the calls will > return undef. You're seeing the error raised by the eval { } that we > wrap the calls in.
Practically every piece of perl code using eval {} has the same problem, and in Tk this was solved by wrapping every "eval { ... }" into "eval { local $SIG{__DIE__}; ... }". Later a subroutine named "catch" was defined doing exactly this. I am not exactly suggesting to go this way in TT2, but wanted just to point out that there's a possible workaround. Regards, Slaven
Ticket migrated to github as https://github.com/abw/Template2/issues/143