Until i fully understand how cgi.pm (just one of many modules) works, i'll try to work my own way out of situations
I agree with Ovid and tilly, but I'm not going to debate this point. Follow the links if you'd like to get my position.
As a fellow programmer, a Saint here, a Perl 5 Porter, and an author, I have a request of you. Please do not share this code with anyone else. If you do feel compelled to share it, or to use it on the public Internet, please put up strong disclaimers that say, "Do not use this code. I don't know what I'm doing. This is not representative of the Perl language as a whole, good Perl programming practices, modules on the CPAN, or more experienced Perl programmers. Any and all errors and flaws in this code are my own learning experiences, and should not reflect badly upon anyone but myself."
I don't mean this to sound harsh or flippant. I'd just like to stem the tide of bad code being distributed and re-used. If you want to reinvent wheels for your own education, fine. Please don't make things harder for the rest of us who have to deal with bad code on a daily basis.
Thank you.
Update: Removed some punctuation that affected the tone for the worse.
| [reply] |
| [reply] |
Hey, my stuff's not that bad. ;-)
| [reply] |
This is a point of view that comes up every so often. While
the idea of only using what you understand seems reasonable,
actually it is seriously wrong for trivial reasons. If you
think that you are actually doing this, then the only
question is where you start lying to yourself. Because I
guarantee you that that you are using stuff that you don't
understand all of the time. You can't help doing so if you
are getting anything useful done at all, from "Hello, World"
on up.
For an instance of a past conversation like this
see Modules Vs. Manual Coding. I entered that thread fairly late at
Re (tilly) 3: Modules Vs. Manual Coding. (A response that was somewhat heated for
reasons that ichimunki stated.)
About your code as presented, suppose that you write
all of your scripts like this. Suppose that some day
you have a form that managed to get over 2K of data in
it. Your code would break, you would have no idea why it
was broken, and if you were told why you would have no easy
way to fix it. If you used CGI you would be able to change
one word in one place and it all would work.
For this and other reasons, I strongly recommend that
instead of trying the futile path of understanding every
single thing you ever use, learn to leverage effectively
off of the work of others. (Which eventually leads
to the attitudes I suggest at Re (tilly) 1: What if you are not a genius?.) | [reply] |
Parham said:
I also don't use cgi.pm cuz that has OOP in it.
TMTOWTDI.
CGI also has a functional interface.
If you don't feel comfortable using the OO interface, the functional interface is there to be used. (See the CGI docs).
Cheers.
BazB.
| [reply] |
Here is something to consider, from the emminent Dominus: Re: Perl 5.6.1. | [reply] |