I mean, are you suggesting that someone should say that just to be depantic (which I'll understand) or that it is actually reasonable?

It is much more reasonable to make you, the user of Module::X, decide explicitly that it should mess with the internals of an object of Some::Random::Class rather than expect Module::X to just go ahead and do it because Some::Random::Class happens to be implemented using the right type of reference as its blessed thingy.

The author of Module::X should be kind enough to respect that, if ref() reports $parameter to be blessed into Some::Random::Class, then its implementation is off limits. A blessed thingy is a blessed thingy regardless of what type of reference it happens to be. If you want to take the responsibility of relying on Some::Random::Class's implementation, then you can do it... by reblessing it.

If you want targets painted on your boots, do it yourself; don't expect someone else to do it for you.

P.S. If you write modules that would make use of such a misfeature in Module::X, you are almost certainly making poor design decisions.

P.P.S. Setting aside the flagrant disregard of the principles of encapsulation that it would entail, why should Module::X be riddled with sticky parameter checking that would probably only be useful in rare cases anyway? I'm not a fan of bloat. The additional test cases alone would be reason enough to avoid it. As I said elsewhere in this thread, keeping things simple is a sound approach. This suggestion is neither simple nor sound.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: Re: Re: Is "ref $date eq 'ARRAY'" wrong? by sauoq
in thread Is "ref $date eq 'ARRAY'" wrong? by bronto

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.