If you are willing to ship binaries, the usual answer would be: use PAR;. You can also install .par files into the local system using PAR::Dist. To solve the bootstrapping problem (no PAR::Dist on the target system), you can just include that (pure-Perl) module into the installer script. Then it requires either Compress::Zlib and Archive::Zip to be present or an "unzip" tool. ActiveState's Win32 perl includes those modules. Unix usually has an unzip. Perl 5.10 will always include Compress::Zlib and Archive::Zip is pure-Perl and thus it's possible to inline it into the installer script. For an example, check out the local-path-installer script I hacked up for bugzilla .
As for the problem of the original poster: You could check out Adam Kennedy's "pip" tool.
Cheers, Steffen
| [reply] |
If you intend to embed modules into your application, your application can use lib to find them in your own private library directory (a part of your application). After use lib, perl will see the updated value of @INC in its search for subsequent use statements.
BEGIN { $INSTALLDIR = my_fun_to_find_my_own_install_dir() }
use lib "$INSTALLDIR/privatelib";
use Acme::SuperModule qw(whatever);
The upside is that you have some control over the versions that folks will use, and thus you can more easily guarantee proper execution. The downside to this approach is that the writer of that embedded module (e.g., Acme::SuperModule) might fix a critical bug, and your customers won't get the benefits until you ship them a new version.
-- [ e d @ h a l l e y . c c ]
| [reply] [d/l] [select] |
Thanks, I knew about "use lib" for my own lib paths, just never tried to have a CPAN module like DBI in my own path.
I just did a manual make of DBI from source, all the files are in the usual blib directory, I'm thinking that if I put everything of blib (except the docs) as part of my distribution (keeping the same structure like: lib/auto, lib/Bundle, lib/DBD, etc.) it should all work. I guess I'll just go ahead and do that, and report back.
Update Yes, it's as simple as that, I took the blib/lib directory, and moved it somewhere, and just do "use lib" to point there, all worked fine. | [reply] |