Sure you are allowed to be creative. The problem is when the code you write does not work robustly because you make too many assumptions. If you reinvent the wheel, then the one you make should at least be round as well.

And to be honest, I use CPAN modules for exactly the same reason I use Perl: because I'm too lazy to take care of everything myself. Others have spent a good amount of time creating solutions that work reliably and don't trip over unusual input. Why should I go to the trouble of reimplementing all of that for what conceptually is a very simple task?

Like in my previous node on this thread: I want the hostname from a URL. So I just take a module and say "I want the hostname". And now I know that whatever URLs I ever throw at it, it will always work right. Even if I throw a gopher:// at it. Or something else I never thought of when I was writing the script. It doesn't break.

And if I really do want to implement a hostname URL extraction, I have the module's source to read.

Makeshifts last the longest.


In reply to Re^5: url2link by Aristotle
in thread Url2Link 0.1 GUI/TK by m_dv

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.