in reply to why use module??

You might want to put your common code in a module for 2 main reasons: modularity of the code which leads to ehanced maintainability and speed if you use mod_perl.

I found that putting code in modules makes it much easier to manage it than including it through a do (or physically): each module has its own namespace (package), which reduces the risks of name collision. Instead of having to know all of the functions in the common file to avoid re-using the name you will have a foo function in your main code and a MyModule::foo function in the module. You can also use module variables, which will not be seen, and thus can't be mistakingly overwritten, by the main code.You can also have several modules, included only when needed, which will decrease the loading time of the code.

If you use mod_perl you can also pre-load the module(s) so you don't have to pay the price for loading it each time you use it.

Generally speaking using module helps you produce better , more modular code. You don't have to use them, but you will probably become a better coder if you do.