Howdy!

I can't tell if my posited circumstance is in place.

Whether I say $request->new or ref($request)->new has no effect on the assumption that the ref($request) is of the appropriate class (either directly or by inheritance). If it is important to verify the particular package that a ref is blessed into to ensure that the ->new part goes to the right place, then you need to check that explicitly. I don't see where that bears on the particular dispute at hand.

The sample code presented would lead me to the presumption that the range of values ref($request) could take would all have the expected methods available to it. The code would die if that assumption were invalid. If I were faced with that range of classes for $request, I would have to dredge through the various packages to discern what variations in behavior were occurring to figure out just where to patch finish().

I did note that I assumed that the packages were documented to permit users to know what methods were provided where. I'm still not seeing the objection.

yours,
Michael


In reply to Re: (Re:)+ $class = ref $class || $class by herveus
in thread Constructor/Factory Orthodoxy by mojotoad

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.