Simian Circleted hawkins
 Home  About  Perl Scripts  Forum  Articles  Downloads  Links  Sitemap  Contact    

 

Why I rarely use Perl Modules

07 March, 2010

Perl is a very flexible programming language and you can do anything from a simple print of a single line of  text to a huge application that would put most OS's to shame. There are a hundred and one ways of doing the same thing and when you find your niche, you tend to run with it.

 

One major aspect of Perl is, that there are thousands of modules to help you do things. Simply use the module in your program and it will handle whatever it's supposed to, as long as you match it's code calls. You can use several modules in a script if needed. I have found that, in many cases, what I am doing can be done without the module, with less code and more often than not - get a much faster result.

 

Such a case surfaced today as I set about coding a forum delete for the bulletin board software. Each forum has its own files and folders. A small flat-file database handles the forums ID, Name and description. Latest postings are recorded for the board homescreen in a one line file. All of these have to be deleted when I want to remove an entire forum from the board.

 

This entails directory work that I had not done before, so I Googled it. In most cases the forums, blogs and tutorials all led me to a module named File::Path. Now the source for this is around 900 lines of code - lose the blurbs and you still end up with hundreds of lines. Then, of course, I'd have to code into my script all that's needed in order to tap the module. I thought this was overkill (a bit like the CGI module).

 

I've ended up doing the usual. Coding it all manually and have managed the entire process in 18 lines of code.

 

I'm not against modules, I use LWP sometimes and occasionally the CGI qw standard one for the odd passiing of values. My mind says, "Why call up something that uses more code, plus the time of calling it, when I can to the same in a few lines?"

 

posted: 23:08   link  |  comments  (0)   . . . . .  up

 

 

Bulletin board growth

03 March, 2010

I've managed to get SCBB to the point where I can add forums. Easier than I thought it would be, but not as easy it could have been. As is the case with stuff like this, once you get the core idea up and running, you see the little bits that need adding or adjusting.

 

Why not have categories too?

You mean that having the possibility of up to 26 forums is not enough?

 

Whilst roaming around the web looking at different forum communites, very few have even half that amount (there are a couple which exceed 26 forums with several categories).

 

The actual base size is quite small, additional forums will, of course, increase that size online as your board grows.

 

I hope to have this done and dusted before summer.

 

posted: 09:21   link  |  comments  (0)   . . . . .  up

 

 

 

top of page

 

 Home  About  Perl Scripts  Forum  Articles  Downloads  Links  Sitemap  Contact    

 

© Simian Circles, 2010