Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > When is a program too big for one file?

Reply
Thread Tools

When is a program too big for one file?

 
 
$_@_.%_
Guest
Posts: n/a
 
      01-27-2004
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?
 
Reply With Quote
 
 
 
 
gnari
Guest
Posts: n/a
 
      01-27-2004
<$_@_.%_> 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






 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-27-2004
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
erl programs accross multiple files, but im not sure at what
oint 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)
 
Reply With Quote
 
$_@_.%_
Guest
Posts: n/a
 
      01-28-2004
Just a quick message to say Thank You to: Walter Roberson and gnari
For their responces, much appreciated.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Ruby 0 12-24-2008 05:07 AM
Photos for email.... How big, is too big? Big.David.NJ@gmail.com Computer Support 8 01-30-2008 02:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57