I have a Perl script (foo.pl) that loads Foo.pm from the same directory using the require mechanism:
require "./Foo.pm";
...
my $foo = new Foo::Bar;
Foo.pm adheres to the standard module format:
package Foo::Bar;
...
1;
Instead of distributing my application as two files (foo.pl and Foo.pm), I would like to distribute only one file. In particular, I would like to make Foo.pm part of the foo.pl script.
How do I achieve this?
The trivial approach of simply merging two files (cat foo.pl Foo.pm> foo2.pl) does not work.
knorv source
share