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;
The Foo.pm adheres to the standard module format:
package Foo::Bar;
...
1;
Rather than distributing my application as two files (foo.pl and Foo.pm) I'd like to distribute only one file. More specifically I'd like to make Foo.pm part of the foo.pl script.
How do I achieve that?
The trivial approach of simply merging the two files (cat foo.pl Foo.pm > foo2.pl) does not work.