Smitty has asked for the wisdom of the Perl Monks concerning the following question:
I have a couple of Perl programs that share common code. I've placed the common code into packages, each package in its own file, creating modules.
However, each program is currently distributed as a single file, so I have another script that essentially concatenates the main file and the packages files, by replacing use package::name with the contents of package/name.pm, and adding the necessary BEGIN and import lines. This generally works, but seems clumsy.
Is there an easier or sanctioned way of accomplishing my goal?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cat'ing perl modules into single file script
by Fletch (Bishop) on Nov 24, 2008 at 03:00 UTC | |
|
Re: Cat'ing perl modules into single file script
by GrandFather (Saint) on Nov 24, 2008 at 02:14 UTC | |
|
Re: Cat'ing perl modules into single file script
by Smitty (Beadle) on Nov 24, 2008 at 03:31 UTC | |
by GrandFather (Saint) on Nov 24, 2008 at 03:50 UTC | |
by Smitty (Beadle) on Nov 24, 2008 at 04:33 UTC | |
by GrandFather (Saint) on Nov 24, 2008 at 09:39 UTC |