I found a solution.
You can add your own modules by doing something like this. You need to create a folder tree inside your application folder that looks like this.
/Application (main app container)
/Application/Lib/Modulename/
Inside this modulename you copy the .pm file that you are trying to load. i.e.
/Application/Lib/Modulename/Module.pm
In my case using the Config::IniFiles it will look something like this.
/Application/Lib/Config/IniFiles.pm
Next you need to make Perl add this location to the @INC global. The method i used and though to be the cleanest is
After this Perl will load the modules in your own Lib tree when they are not found.
To overcome the compile errors that occur during BEGIN{} you can create an additional .pl file in which you load the modules. So the struct might look like this.
Main Application.
if(ModCheck("Getopt::Long") and ModCheck("Config::IniFiles") ){
require "./lib/modules.pl";
}else{
print "Some required modules are not present!";
}
## ModCheck subroutine ##
sub ModCheck{
my $module = $_[0];
eval "use $module";
if($@){
return 0;
}else{
return 1;
}
}
- if(ModCheck("Getopt::Long") and ModCheck("Config::IniFiles") ){
- require "./lib/modules.pl";
- }else{
- print "Some required modules are not present!";
- }
- ## ModCheck subroutine ##
- sub ModCheck{
- my $module = $_[0];
- eval "use $module";
- if($@){
- return 0;
- }else{
- return 1;
- }
- }
modules.pl
use Getopt::Long;
use Config::IniFiles;
return 1;
- use Getopt::Long;
- use Config::IniFiles;
- return 1;
well i hope this will help anyone else

-Rgrds Chris
1 + 1 = 10 + 1 = 11 + 11 = 110