CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: General Discussions: General Questions:
my 2 red pennies worth..........



Aug 4, 2000, 11:34 PM

Post #1 of 4 (8889 views)
my 2 red pennies worth.......... Can't Post

First off, i could not seem to find the appropriate board for this, but this one is the closest, so if you do not wish to hear my rantings (at which i wrote at 3:36 am, while on a caffine rush)Then do not read any further....


for the rest of you,
Let me start by saying i LOVE writing perl, i think it is very exhilerating writing scripts.
But, For the life of me, i cannot seem to figure out why on gods green earth anyone would want to use a module or lib (other than lazyness) I have looked into a few of them, and (most) of them are written very well, but they are built for multiple commends and functions, and from the use i have seen them used in, it is a HUGE waste of resources to take a rather large module (like perl.lib) and use it for 1 or 2 of its functions. everything that is written out in those modules are learnable by anyone serious about perl, i learned my perl from "perl for Dummies" on my own, and i feel that there is not anything in those modules that i cannot do on my own, modules seem like a lazymans (or womans) way of getting what they want without the work. I do not intend to insult anyone by this, but my thought is CMON, NO PAIN NO GAIN!. Besides, If you go through making scripts with only modules, are you REALLY learned in perl?? i think not, when the day comes (and it will for those that use the modules) that someone wants you to build a fast, effective, light on resource script, you will be rushing back to this forum and begging someone to "teach you perl in 24 hours".
Now, i know that some of you are going to say,
"it is faster to just use modules then to learn and write out perl"
but i say to that:
"it is also faster to die by running out in front of a bus, instead of waiting to grow old, but it does not mean it is wiser"
speed will never replace good old fashion dirt digging hard work.
So on this subject i say

Please, for your sanity and mine, please, please, learn PERL not modules.

I thank you for your time.


Aug 5, 2000, 9:27 AM

Post #2 of 4 (8889 views)
Re: my 2 red pennies worth.......... [In reply to] Can't Post

Quicker development time.
Easier to debug.
Easier to maintain.
Easier to read and follow.
Portable reusable code is good.

using modules isn't a reason to quit understanding how your code works. It a way to get the results faster and easier by taking advantage of the kindness of those who have already faced your current task, and have put the solutions in a nice package.

The vast library of modules, and the well written documentation is one of Perl's most attractive features, IMO.



Aug 5, 2000, 8:48 PM

Post #3 of 4 (8889 views)
Re: my 2 red pennies worth.......... [In reply to] Can't Post

Everyone has there own reasons for using or not using modules. I only use modules when I have made them my self.

I made four for personal use and there are 20 + other scripts using them. That way I can update all of the code that is not really neccesary in the other 20 + scripts in one or two files. I used to have to do all 20 + scripts invididualy. What a pain.

I used to use cgi qw standard or somthing, it was to read the url's values. I haven't used it in a while, Now I just use the code that I was told is in the mod. It works the same.

The reason I don't use modules other than the ones mentioned is because I think that it's logical that it would be slower to retrieve a module and then execute the code.

More files to open more work. Though the time difference is probably nano seconds, My boss makes sure I do that fastest methods possible.



Aug 6, 2000, 10:31 AM

Post #4 of 4 (8889 views)
Re: my 2 red pennies worth.......... [In reply to] Can't Post

Modules are not always evil, but there are a few that have grown too large. But there are two good times to use modules.

First there are some things that contain specialized stuff that the average recent graduate of "Perl for Dummies" is not ready to develope themselves. You can just use the module and get your program working quickly. Then you can worry about optimizing if needed.

Second are other things you just do so often that they should be in a module. The most obvious example is getting the hash of the form data in a CGI script. There exist four options to be found from CPAN:
CGI/ #the old perl 4 way

And if you feel that all four of these solutions a bloated, it is probably a good idea to create a module with just the one function you need, to parse the form. Then you don't have to paste the function into each script.

If speed is the issue you can use mod_perl. You will still take a small performance hit the first time the script is called as the modules are loaded, but additional calls should run in the same time with or without modules.

[This message has been edited by rGeoffrey (edited 08-06-2000).]


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives