abw / Template2

Perl Template Toolkit v2
http://template-toolkit.org/
146 stars 94 forks source link

No need to check for definedness before calling ref #307

Closed petdance closed 1 year ago

toddr commented 1 year ago

ref undef doesn't warn on 5.8?

petdance commented 1 year ago

Oh whoops, I didn't mean to push more stuff in to this PR. Sorry about that.

I didn't check ref undef on 5.8. If it does warn, then maybe another reason to update to 5.10. :-)

petdance commented 1 year ago

I'm currently building a 5.8 to see....

petdance commented 1 year ago

No, Perl 5.8.9 does not warn on ref undef.

$ perl -lwe'my $x; print ref $x; print ref {}'

HASH
clifford [20:02:43] speed-tweaks ~/Template2 $ perl -v

This is perl, v5.8.9 built for x86_64-linux
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2008, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
petdance commented 1 year ago

Is this something you can merge? Should I split the changes up into two different PRs?

toddr commented 1 year ago

Is this something you can merge? Should I split the changes up into two different PRs?

Thank you for your persistence. I'm asking @atoomic to take a look and then I'll get this out soon.

petdance commented 1 year ago

Thanks. Glad to help.