in reply to Re (tilly) 1: Which is better - one large file or multiple files?
in thread Which is better - one large file or multiple files?

Of course, if you're feeling daring, you can put your subroutine sub foo in a different file by saving it as foo.pl then, as and when your main script needs it, call it with
do 'foo.pl';
The disadvantage of this is that it doesn't get compiled unless and until you call it.
The advantage is, it doesn't get compiled unless and until you call it.

§ George Sherston

Replies are listed 'Best First'.
Re (tilly) 3: Which is better - one large file or multiple files?
by tilly (Archbishop) on Aug 10, 2001 at 04:59 UTC
    It is better to use Perl's AUTOLOAD for delayed loading. After all that is what it is for.

    If you just want to be able to take your program and force lazy loading of subroutines, you can use AutoLoader to do the loading and AutoSplit to split your file. That will perform much better on repeated calls to the function, and you can develop with a single huge file if you want.