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

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

Thread Next
From:
James E Keenan via RT
Date:
October 13, 2018 12:31
Subject:
[perl #133585] BBC: 1ed4b7762a breaksMIKIHOSHI/File-Stamped-0.08.tar.gz et al.
Message ID:
rt-4.0.24-24110-1539433855-11.133585-15-0@perl.org
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?

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133585

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