modularizing a large Perl script

December 3rd, 2003 at 10:24 am

The Perl script I’m hacking at now at work promises to become very large. A few KLOCs at the least. I’ve written scripts up to about 1.5 KLOC before, all in one file, and my experience with it is that it’s not simple to manage them. In such large files, it’s not simple to conveniently find stuff. And, it’s hard to have this picture of the whole thing in your head, which is important IMHO.

So, I’m planning to do it smarter, from the beginning, this time. I want to divide my script to modules. I’m just not sure how… it’s 2 ways, as I see it, OO or just modules of related functions. Any ideas are welcome.

Related posts:

  1. using PAR to create a custom “hosted” Perl environment
  2. test vectors generation in Perl
  3. MIX in Perl
  4. once again: perl, serial ports and what’s between them

One Response to “modularizing a large Perl script”

  1. Matt FienbergNo Gravatar Says:

    Eli,

    I’ve been struggling with the same issue for a Perl-Tk application, which, interestingly enough, seems to be in your own field…

    I’m a hardware designer, working in board design as well as FPGA design. My application is aimed at a providing a alternative methodology to PCB design. (I’d be happy to go into further detail if your interested in a less public forum…)

    In any case, I was wondering how you’ve dealt with the modularization issue, as it seems you haven’t gotten any responses since 2003…

    Thanks,
    Matt

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)