in reply to modularization, memory usage and performance

Using globals will not slow down your program. In fact, you were using globabls before, but they were in the "main::" package because you didn't put them anywhere else. Something else is causing your slowdown.

You might be better off using one of the dbm files, like DB_File or GDBM_File, than Tie::Persistent. The trouble with SDBM_File is that it has very small size limitations.

It also sounds like you are creating libraries that have no package declaration and just pulling all of their functions into your main program. If that's what you're doing, I would advise you to put them in a separate package instead, to avoid confusion and namespace collisions.

  • Comment on Re: modularization, memory usage and performance

Replies are listed 'Best First'.
Re^2: modularization, memory usage and performance
by jmagiera (Novice) on Feb 10, 2005 at 07:57 UTC
    Thanks for the input, perrin. DB_File and GDBM_File sound very promising. I am always a bit hesitant about packages that come with C sources because I want don't want my users to have to compile something, but I hope to find a way to precompile those packages for Windows (because most people don't have a compiler on Windows).

    As for creating libraries with no package: you are right, each "library" is just a collection of subs without any namespace (well, main::). I'll work on that.

    -----------
    Perl help me.
      There are some dbm modules that come with ActiveState Perl on Windows, so they don't need to be compiled or installed separately. Check which ones they are and use one of them.