For quite a while I've had writing just such a beast on my to-do list. My plan was to overload the object so that any use other than calling a method on it returned undef.

Along similar lines, I'd like it to be easy to write code where, if you don't bother to check for success, then the module dies for you. But if you do bother to check for success, then the module returns a failure code and doesn't die.

To combine both of the these conveniences means that I need the "invalid object" to die if it gets destroyed before undef was ever returned (if that option has been turned on, which would probably be the default).

If you flesh this out, please let me know so that I can use it. (:

(So part of the plan is for the "invalid object" to record which method failed on which object along with a nice, detailed explanation as to why so there'd probably be one or two special methods on the "invalid object" that allowed you to retrieve these details as well -- and these methods would also disarm the auto-die feature.)

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Stringing method calls by tye
in thread Stringing method calls by mirod

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.