in reply to Subroutines loaded in from other files
Make a file named Module.pm in '/usr/home/you/modules'. This one should contain something like:
One of those for each subroutine. Obviously you must substitute your own names and code. That 1; at the end is required!package Module; require Exporter; @ISA = Exporter; @EXPORT = qw(dostuff); sub dostuff { my ($dostuff) = @_; return $dostuff } 1; __END__
You then call them by adding:
use lib '/usr/home/you/modules'; use Module qw(dostuff);
to your main program.
I disagree with using a 'main' subroutine. It is un-Perlish and serves no purpose.
--
Regards,
Helgi Briem
helgi AT decode DOT is
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Subroutines loaded in from ohter files
by gjb (Vicar) on Nov 28, 2002 at 16:19 UTC |