Yes, you can make globals things global, so you don't do things you don't need to do in the subs, or reserve memory . For example, you don't read in every function the config file, normally you load/read the configuration once on begin, and store it in a global var and all read from it
Mm, don't know the complexity of the solution, but normally one tends to do packages and so, that you don't have one large script, instead something modular...
I think you are using DB, right?
The thing is that once the interpretar has reserve X size of system mem, it don't give it back to the system, instead it's available for the interpreter... as far as I know.
Is the application a script or is it a handler? Have you thought about using something like http://maypole.perl.org or http://catalyst.perl.org?
|