It's cargo-cult style programming, sure. I think we need to be careful about just throwing that answer around willy-nilly, though. It was nice of you to provide a link to an article that discusses object construction, but logie17's specific question doesn't get referenced until the last couple of paragraphs.

It might be better to give a quick summary of why it's used (1: to allow object construction via an object rather than just as a class/package method; 2: "Cargo-cult" - I saw somebody else do this, so I'm doing it too even though I don't know why), why it's bad (1: construction via the object could mean a few different things, and you should avoid coding techniques that make your intention hard to fathom; 2: You shouldn't write a particular chunk of code if you don't know why you're writing it - if Billy Smith jumped off the Empire State Building, I suppose you would have to jump off the Empire State Building too), and then link to merlyn's article (for more details about object construction). It's probably a good idea to include a link explaining what cargo-cult programming is if you suspect that the questioner (or someone else reading your reply in distant years) is not familiar with the term.

So many parentheses ...

Sorry about being so pedantic. I don't think there's anything wrong about your reply, and the link is great. I just want folks to be careful that "It's cargo-cult" doesn't end up becoming a cargo-cult reply.


In reply to Re^2: Two argument bless syntax by webfiend
in thread Two argument bless syntax by logie17

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.