On Dec 30, 2007 6:29 AM, jwaixs <[EMAIL PROTECTED]> wrote:
snip
> I just want to split up a big file into smaller parts. But I don't
> know which functioncall I should use for it. Peng is using "require",
> is this the standard way for importing a file?
snip

The require function is one of the standard ways of including code
from another file.  The use function (which uses require, but does a
few other things) is another.  You can also get similar functionality
from the do function, but that is generally not a good idea.

Just breaking up a large file into many small ones is a bad idea,
especially if you are sharing variables between the files.  If your
program is too large then try to break some of the functionality out
into modules instead.  Keep each module independant of the others and
the main program.  This will make it easier to make changes later and
you may even find that you can reuse some of the modules in other
projects.  You can read more about modules in perldoc perlmod or
http://perldoc.perl.org/perlmod.html.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to