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)

From:
Tom Christiansen
Date:
August 3, 2008 10:22
Subject:
Re: Near-FMTEYEWTK instructorial on ties, handles, and methods (was: How to tell whether readline got an error or EOF)
Message ID:
26985.1217784153@chthon
>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.

Oh, BTW, check the bottom of IO::Handle's manpage:

    BUGS
       Due to backwards compatibility, all filehandles resemble
       objects of class "IO::Handle", or actually classes derived
       from that class.  They actually aren't.  Which means you
       can't derive your own class from "IO::Handle" and inherit
       those methods.

You could delegate, though.

--tom



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