in reply to Bundling a module with a distribution (cross-platform)

This is where I often use FindBin to avoid problems based on the user's current directory.

use strict; use FindBin; use lib "$FindBin::Bin/Modules"; print "\@INC: (" . join(",",@INC) . ")\n";

It's unclear from your message how you invoke the script, so I'm not sure if it solves your problem, YMMV. If you need to load different modules (or different builds of the same module that are OS-dependent), take a look at how File::Spec handles it.

Update: Note that I'm not recommending one try to pre-build modules for different platforms to distribute with scripts... only how one might handle loading the appropriate module if one chooses to do so.

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re^2: Bundling a module with a distribution
by anjoschu (Sexton) on Dec 29, 2004 at 20:51 UTC

    I did not know FindBin, thanks for the hint. This will certainly save me some trouble (unless I use PAR). I'm skimming PAR::Tutorial and am going to examine File::Spec, too.

    Update: FindBin works great, thanks again.