J
John
Just checking I'm doing the right thing.
I have a main program (main.pl) and several libraries (LIB1.pm LIBmatrix.pm
LIBgraph.pm) each containing about 50 routines.
I begin:
use warnings;
use strict;
use LIB1;
use LIBmatrix;
use LIBgraph;
There are many options for the user, but no user ever uses all the routines.
The problem is that 'use' will load all the routines when main.pl is
invoked.
As the program has grown I am aware that when main.pl is invoked it is taken
quite a long time to load.
My solution would be to use 'require'. Change LIB.pm to LIB.pl and access
via:
require 'LIB1.pl';
my $x=LIB1::curve($z,$w);
Am I right in thinking that memory usage will fall and loading will be
faster as I only access the routines when requested by the user?
Regards
John
I have a main program (main.pl) and several libraries (LIB1.pm LIBmatrix.pm
LIBgraph.pm) each containing about 50 routines.
I begin:
use warnings;
use strict;
use LIB1;
use LIBmatrix;
use LIBgraph;
There are many options for the user, but no user ever uses all the routines.
The problem is that 'use' will load all the routines when main.pl is
invoked.
As the program has grown I am aware that when main.pl is invoked it is taken
quite a long time to load.
My solution would be to use 'require'. Change LIB.pm to LIB.pl and access
via:
require 'LIB1.pl';
my $x=LIB1::curve($z,$w);
Am I right in thinking that memory usage will fall and loading will be
faster as I only access the routines when requested by the user?
Regards
John