develooper Front page | perl.perl5.porters | Postings from December 2011

Re: [perl #82484] Some PerlIO layers can't be stacked during open

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
December 19, 2011 16:09
Subject:
Re: [perl #82484] Some PerlIO layers can't be stacked during open
Message ID:
CAHhgV8ggAwBSLOkfX=TH-=XdUdK2SyyTcoY6KcSnHH4wqbrOsQ@mail.gmail.com
On Thu, Jan 20, 2011 at 10:49 PM, Leon Timmermans <fawaka@gmail.com> wrote:
> The problem behind this can be summarized to this: «during open() a
> PerlIO layer that defines an Open method can not be pushed on top of
> another layer that doesn't define Open». There are two possible
> workarounds for this:
>
> a) Implement Open in all layers that don't implement it now.
> b) Change the lookup mechanism in all existing Open methods.
>
> I decided to implement option a, because it seem to be the least
> intrusive way to tackle this problem. In the first patch, I introduce
> PerlIOBase_open, a generic open method that does what 90%+ of all
> modules want it to do (open the layer beneath it, and then push the
> current layer on top of it). It also updates the documentation to
> advise people to use it.
>
> The second patch used this to fix this bug (#82484). The third patch
> fixes #80764 using the same Open method (consider my previous patch
> for that bug retracted in favor of this one). These two patches are
> quite trivial :-).
>
> Leon

It seems my patch missed something important: it didn't export the
PerlIOBase_open(). Missed it since they're exported weirdly.

Leon

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