Leo,

Please bear with me for a second as I think out loud. You are trying to overload IO::File and are overloading getline. The inconvenience is that getline's error reporting method relies on $! and you apparently can't "fit" your errors into the set specified by the errnos (and the set cannot be expanded without XS, and probably shouldn't be expanded anyway). In other words, IO::File has proven impractical for your class to inherit from because of a too restrictive error reporting mechanism.

In my opinion, this means that you should not be inheriting from IO::File. Your class must report errors in a way not contemplated by the designers of IO::File. In my opinion, your class and IO::File can not be associated by an ISA relationship, due to this mismatch. In my opinion (and I am no expert on IO::File, so I truly apologize if I misconstrue), one of the apparent implications of the error reporting design of IO::File is that classes that need to report errors beyond "OS errors" cannot really inherit from the class. I would backtrack, redesign your inheritance tree, perhaps document this experience and chalk it up to learning "the hard way" a limitation of IO::File.

,welchavw


In reply to Re: Setting $! to custom values by welchavw
in thread Setting $! to custom values by TheHobbit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.