neversaint has asked for the wisdom of the Perl Monks concerning the following question:

Dear Masters,
Suppose I have the following code (this_code.pl) which contain certain CPAN modules.
#!/usr/bin/perl -w # this_code.pl comes with these two modules and more use Algorithm::Loops 'NestedLoops'; use Algorithm::Diff; # The rest of the code here.
Now, is there a way I can "package" my code above such that anybody using my code above doesn't have to install those two modules in his PC?

---
neversaint and everlastingly indebted.......

Replies are listed 'Best First'.
Re: Executing a Perl script without requiring "use"-d CPAN modules
by marto (Cardinal) on Nov 15, 2005 at 15:44 UTC
Re: Executing a Perl script without requiring "use"-d CPAN modules
by davorg (Chancellor) on Nov 15, 2005 at 15:51 UTC
Re: Executing a Perl script without requiring "use"-d CPAN modules
by b10m (Vicar) on Nov 15, 2005 at 15:56 UTC

    Another approach would be to put the modules in your tarball and use lib (I believe these modules are "pure perl" and don't require compiling).

    --
    b10m

    All code is usually tested, but rarely trusted.
Re: Executing a Perl script without requiring "use"-d CPAN modules
by idsfa (Vicar) on Nov 15, 2005 at 15:59 UTC

    Yes. Unlike the previous joke, this one actually does not install the module.


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon