develooper Front page | perl.perl5.porters | Postings from November 2017

[perl #132475] [PATCH] Tie::StdHandle::BINMODE does not handle LAYERargument

Thread Previous
From:
Hauke D
Date:
November 20, 2017 15:31
Subject:
[perl #132475] [PATCH] Tie::StdHandle::BINMODE does not handle LAYERargument
Message ID:
rt-4.0.24-7190-1511191883-1445.132475-75-0@perl.org
# New Ticket Created by  Hauke D 
# Please include the string:  [perl #132475]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132475 >


Dear Perl 5 Porters,

The final test in the attached script always fails (tested on Linux, 
Perl 5.8.1 thru blead, and Windows on several Perl versions). The reason 
is that Tie::StdHandle::BINMODE is implemented like this:

  sub BINMODE { binmode($_[0]) }

meaning that the layer argument is not passed through. The attached 
patch fixes this (tests included) by changing the implementation to:

  sub BINMODE { &CORE::binmode(shift, @_) }

This is based on the first of the patches that I wrote about a while ago 
here (this time submitted as a bug for tracking):
https://www.nntp.perl.org/group/perl.perl5.porters/2017/09/msg246402.html

Thanks, Best Regards,
-- Hauke D

Thread Previous


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