Skip Menu |

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

Report information
The Basics
Id: 102391
Status: rejected
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: garu [...] cpan.org
Cc:
AdminCc:

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



Subject: minimum version 5.8.0?
First of all, *THANK YOU* for Template Toolkit. It's a huge life saver \o/ According to the Makefile.PL, the minimum perl version is 5.6.0. But the "perlver" tool (which ships with Perl::MinimumVersion) accuses that Template::Document is using a binmode construct that is only available on 5.8.0. In fact, https://metacpan.org/source/ABW/Template-Toolkit-2.26/lib/Template/Document.pm#L308 says: binmode $fh, ":utf8"; And in 5.6 PerlIO existed but was not loaded by default, and the only "disciplines" available were ":raw" and ":crlf". I'm not sure what would happen if an unknown discipline is called in 5.6. In current perls it triggers a warning and keeps going. If you think this is alright for Template::Document, please feel free to close this ticket. Otherwise, the perl minimum version should probably be updated to 5.8.0.
On 2015-02-27 01:54:43, GARU wrote: Show quoted text
> First of all, *THANK YOU* for Template Toolkit. It's a huge life saver > \o/ > > According to the Makefile.PL, the minimum perl version is 5.6.0. But > the "perlver" tool (which ships with Perl::MinimumVersion) accuses > that Template::Document is using a binmode construct that is only > available on 5.8.0. In fact, https://metacpan.org/source/ABW/Template- > Toolkit-2.26/lib/Template/Document.pm#L308 says: > > binmode $fh, ":utf8"; > > And in 5.6 PerlIO existed but was not loaded by default, and the only > "disciplines" available were ":raw" and ":crlf". > > I'm not sure what would happen if an unknown discipline is called in > 5.6. In current perls it triggers a warning and keeps going. If you > think this is alright for Template::Document, please feel free to > close this ticket. Otherwise, the perl minimum version should probably > be updated to 5.8.0.
The pre-5.8.0 compat (if it's still interesting) could be saved by putting this construct into a string eval: eval q{binmode $fh, ":utf8";}
On 2015-02-27 14:34:02, SREZIC wrote: Show quoted text
> On 2015-02-27 01:54:43, GARU wrote:
> > First of all, *THANK YOU* for Template Toolkit. It's a huge life > > saver > > \o/ > > > > According to the Makefile.PL, the minimum perl version is 5.6.0. But > > the "perlver" tool (which ships with Perl::MinimumVersion) accuses > > that Template::Document is using a binmode construct that is only > > available on 5.8.0. In fact, > > https://metacpan.org/source/ABW/Template- > > Toolkit-2.26/lib/Template/Document.pm#L308 says: > > > > binmode $fh, ":utf8"; > > > > And in 5.6 PerlIO existed but was not loaded by default, and the only > > "disciplines" available were ":raw" and ":crlf". > > > > I'm not sure what would happen if an unknown discipline is called in > > 5.6. In current perls it triggers a warning and keeps going. If you > > think this is alright for Template::Document, please feel free to > > close this ticket. Otherwise, the perl minimum version should > > probably > > be updated to 5.8.0.
> > The pre-5.8.0 compat (if it's still interesting) could be saved by > putting this construct into a string eval: > > eval q{binmode $fh, ":utf8";}
Ah, disregard this answer. Perl 5.6 already supports two-arg binmode, but not this value for the 2nd argument. But as this code branch is only accessed if $UNICODE is set which is only the case for perl 5.7 and later, this is not a problem.
On Fri Feb 27 14:42:50 2015, SREZIC wrote: Show quoted text
> > Ah, disregard this answer. Perl 5.6 already supports two-arg binmode, > but not this value for the 2nd argument. But as this code branch is > only accessed if $UNICODE is set which is only the case for perl 5.7 > and later, this is not a problem.
Great! I'll close this ticket until we can have something in perlver such as binmode $fh, ':utf8'; # no perlver or binmode $fh, ':utf8'; # perlver 5.8 The feature request is already open in https://rt.cpan.org/Ticket/Display.html?id=87883 Thanks for taking the time to analyze this!