develooper Front page | perl.perl5.porters | Postings from October 2018

Re: [perl #133585] BBC: 1ed4b7762a breaksMIKIHOSHI/File-Stamped-0.08.tar.gz et al.

Thread Previous | Thread Next
From:
Tony Cook
Date:
October 15, 2018 03:19
Subject:
Re: [perl #133585] BBC: 1ed4b7762a breaksMIKIHOSHI/File-Stamped-0.08.tar.gz et al.
Message ID:
20181015031935.js4rkwbtkn3rvfri@mars.tony.develop-help.com
On Sat, Oct 13, 2018 at 05:30:55AM -0700, James E Keenan via RT wrote:
> On Sat, 13 Oct 2018 06:59:09 GMT, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
> > BBC candidate: https://rt.cpan.org/Ticket/Display.html?id=127361
> 
> TonyC, list:
> 
> In this case the CPAN author is tie-ing a filehandle and creating a WRITE method which internally invokes CORE::syswrite:
> 
> #####
> sub TIEHANDLE {
>     (
>         ( defined( $_[1] ) && UNIVERSAL::isa( $_[1], __PACKAGE__ ) )
>         ? $_[1]
>         : shift->new(@_)
>     );
> }
> 
> sub PRINT     { shift->print(@_) }
> 
> sub WRITE     { shift->syswrite(@_) }
> #####
> 
> Is there a way to adapt this that we can recommend to CPAN authors as best practice/standard operating procedure?

File::Stamped accepts a iomode parameter which defaults to ">>:utf8"
and that's in use in the test case.

Simplest in this case would be for the test case to use ">>:raw" or
something similar.

Tony

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About