develooper Front page | perl.perl5.porters | Postings from August 2008

Re: Near-FMTEYEWTK instructorial on ties, handles, and methods (was: How to tell whether readline got an error or EOF)

Thread Previous | Thread Next
From:
Ed Avis
Date:
August 3, 2008 02:19
Subject:
Re: Near-FMTEYEWTK instructorial on ties, handles, and methods (was: How to tell whether readline got an error or EOF)
Message ID:
loom.20080803T091325-478@post.gmane.org
Tom Christiansen <tchrist <at> perl.com> writes:

>For my part, I in implementing a class that I expected folks to call
>tie *GLOB .... and hence invoke TIEHANDLE on, for that I would
>specifically document precisely *which* operations were supported.

I will do that - but it leaves the question of which operations
*should* be supported.  If you write a tied filehandle class, what is
the reasonable minimum interface that it should provide to be worthy
of the name?  I had assumed I just need to implement every filehandle
method in perltie(1), but it appears that is neither necessary nor
sufficient to give something that acts reasonably close to a real
filehandle.
 
>Anything beyond that is asking for... something beyond that.

If I understand you correctly, you are saying that there is no way in
general to tell whether getc() got EOF or an error.  You can find out
if the filehandle is a real one, but a tied filehandle is under no
obligation to provide this interface.

-- 
Ed Avis <eda@waniasset.com>


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