When is a program too big for one file?

Discussion in 'Perl Misc' started by $_@_.%_, Jan 27, 2004.

  1. $_@_.%_

    $_@_.%_ Guest

    HI, this application im currently developing is already
    737 lines long, 501 of which are all callbacks.

    It is my understanding that there is a way to split
    perl programs accross multiple files, but im not sure at what
    point one should think about doing this. Also where would
    be a good place to find out about doing this effectively?
     
    $_@_.%_, Jan 27, 2004
    #1
    1. Advertising

  2. $_@_.%_

    gnari Guest

    <$_@_.%_> wrote in message
    news:OtARb.12448$...
    > HI, this application im currently developing is already
    > 737 lines long, 501 of which are all callbacks.
    >
    > It is my understanding that there is a way to split
    > perl programs accross multiple files, but im not sure at what
    > point one should think about doing this.


    when it is starting to bother you, the programmer/maintainer.

    when you find that some parts oer more or less self-contained
    and independent from other parts, and might be reusable in
    other projects

    when more than one person are working on different
    parts of the program

    how to do it, depends on how you want to split it
    - .pm modules
    - require
    - do
    - cat part1 part2 part2 > prog.pl
    - use a Makefile to cat part1 part2 part2 > prog.pl
    - probably many other ...

    perldoc -f require
    perldoc -f do
    perldoc perlmod
    perldoc perlmodlib


    gnari
     
    gnari, Jan 27, 2004
    #2
    1. Advertising

  3. In article <OtARb.12448$>, <$_@_.%_> wrote:
    :HI, this application im currently developing is already
    :737 lines long, 501 of which are all callbacks.

    :It is my understanding that there is a way to split
    :perl programs accross multiple files, but im not sure at what
    :point one should think about doing this. Also where would
    :be a good place to find out about doing this effectively?

    There is a school of thought that programs should be at most one
    screen-full. And that school of thought grew up in the days when
    screens were often not more than 24 lines long.

    The more usual perl way would be to split along functional lines.

    By the way, if 501 lines are callbacks, could the program perhaps
    be re-written to be table-driven ?

    --
    I don't know if there's destiny,
    but there's a decision! -- Wim Wenders (WoD)
     
    Walter Roberson, Jan 27, 2004
    #3
  4. $_@_.%_

    $_@_.%_ Guest

    Just a quick message to say Thank You to: Walter Roberson and gnari
    For their responces, much appreciated.
     
    $_@_.%_, Jan 28, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin
    Replies:
    0
    Views:
    477
    Martin
    Aug 4, 2004
  2. Shaguf
    Replies:
    0
    Views:
    367
    Shaguf
    Dec 24, 2008
  3. Shaguf
    Replies:
    0
    Views:
    463
    Shaguf
    Dec 26, 2008
  4. Shaguf
    Replies:
    0
    Views:
    250
    Shaguf
    Dec 26, 2008
  5. Shaguf
    Replies:
    0
    Views:
    227
    Shaguf
    Dec 24, 2008
Loading...

Share This Page