Thanks for the detailed input Simon.

Simon Wilcox wrote:
> Hi,
> 
>>  > perl -MTemplate -le 'Template->new->process(\q[[% 1 + "" %]])'
>> Argument "" isn't numeric in addition (+) at input text line 1.
>> 1

> This is a perl problem, not a TT problem:
> 
> sim...@defiant:~$ perl -wle 'print 1 + ""'
> Argument "" isn't numeric in addition (+) at -e line 1.
> 1

If you're comparing one-liners though, it should be considered important 
that you've explicitly turned on warnings in the latter with the -w 
switch, but there's no option to enable/disable in Template. Without it, 
of course:

$ perl -le 'print 1 + ""'
1

Similarly, compare and contrast:

$ perl -MTemplate -le 'Template->new->process(\q[[% blah %]])'
$ perl -le 'print $blah'
$ perl -wle 'print $blah'
Name "main::blah" used only once: possible typo at -e line 1.
Use of uninitialized value $blah in print at -e line 1.

or even:

$ perl -MTemplate -le 'Template->new->process(\q[[% BLOCK blah END; 
BLOCK blah END; %]])'
$ perl -le 'sub blah {}; sub blah {}'
$ perl -wle 'sub blah {}; sub blah {}'
Subroutine blah redefined at -e line 1.

Why are some warnings expected and others not? Or am I being 
disingenuous in this comparison? Are there any other perl warnings that 
Template is expected to produce?

> I get the same result in 5.10.0 on lenny, 5.8.8 on etch and 5.8.8 on my 
> Mac Leopard.
> 
> Having said that, if it wasn't doing that on 2.14 and is now on 2.19, 
> perhaps it is a regression in TT or one of it's supporting modules...

I suspect, without easily being able to test it, that the only issue is 
that TT is acting differently between perl 5.8 and 5.10, and the version 
of TT is irrelevant. Doesn't this make it a TT issue?

Cheers to everyone with their help, even if I have reached somewhat of a 
stalemate and will probably end up with a hack on $SIG{'__WARN__'}

:Travis




This email, including attachments may be privileged, confidential and is 
intended exclusively for the addressee. The views expressed may not be official 
policy, but the personal views of the originator. If you have received this 
email in error please notify the sender and delete it from your system.  Emails 
are not secure and may contain viruses.  No liability can be accepted for 
viruses that might be transferred by this email or any attachment.


_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to