Please allow me to defend my choice of not using a module for this...
There is absolutely nothing wrong with "rolling your own", so long as you understand why you are doing it. After all, how do you think the modules on CPAN were created? While many were for new functions, others were expanding upon previously created functionality or approaching the problem from an entirely different direction (the plethora of mail modules comes to mind).

However, if you happen to be working for a company, you are doing them a disservice. If you are new to Perl, as your post suggests, then you won't write Perl code that is as stable and well-thought out as most of the modules out there. Your company has to deal with your substandard code and is probably not getting best value for what they are paying you. As a matter of simple ethics, I would recommend not "rolling your own" in a business environment without very compelling reasons.

When I use a template to achieve a result, I've learnt how to use a template, but when I do it myself I better my understanding and knowledge of perl.
The above comment suggests to me that you would benefit greatly from using more modules and templates. If you don't use them, you can't appreciate how your knowledge of Perl increases through said use. Further, without those modules, Perl wouldn't be as popular as it is and you probably wouldn't be coding in it.

Much of being a good Perl programmer is being a good programmer. Learning the benefits of code reuse and modularization aren't specific to Perl, but you must understand these issues if you want to be a serious programmer. Read through the white paper for Template::Toolkit. In just fifteen minutes to half an hour of reading, you will have learned more about Web site creation and maintenance than I learned in my first six months of "doing it by hand." It covers the benefits of code reuse and modularity from a CGI perspective. Just some of the topics covered:

If you really want to be writing CGI programs, those are critical issues. By understanding them and getting them out of the way, you can focus on Perl.

Don't get me wrong, I meant what I said. There is NOTHING wrong with writing your own version of modules that are already out there if you are doing this to further your understanding. I have personally written a couple of CGI parsing routines in order to better understand the CGI protocol. However, if you are inexperienced with Perl and you arte doing this for an employer (as your post and home node hint at), you are doing them a disservice. That, in my opinion, is unethical.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Learning or being unethical? by Ovid
in thread REGEX: muliple search and replace by whahoo

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.