In your IO::File wrapper you should override isa. Why not? It completes the wrap properly. This is a good argument for isa.

Are they grinding you down today? Reusability is based first on usability. Ensuring that good code will interface with the most lousy code possible may be efficacious, but it is not maximizing reusability.1 Instead it's a way to prematurely embrittle the code.

When possible I avoid eval for errors which will be immediately handled.2  So to check if a param can do something, if it even is a blessed thing I'd use these terms in some conditional:

ref $it and $it=~/=/ and $it->can($meth) and $it->$meth();


1 Having the largest user base doesn't mean the code is more reusable. The word "pandering" begs usage here. It's like that. Stop it, go 'way. Bad word!

2 The "throw" analogy for exceptions is appropriate: raise an exception when you can not handle the problem locally.


In reply to Re: •Re: Re: •Re: Re: Say no to ref $thing eq "Expected::Type" by rir
in thread Putting file contents into a scalar by ByteOrNybble

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.