Reputation: 410
I am facing a really strange issue. I have a perl script which internally calls a another perl script. When I am running manually from unix I am not facing any issue.
Now when same script when scheduled from control-m scheduler gives compilation error for internal script for finding date:manip package.
Can't locate Date/Manip.pm in @INC.BEGIN failed--compilation aborted for script.
Unfortunately I cant attach script here due to client issue.
But can somebody please help?
Upvotes: 0
Views: 519
Reputation: 391
This typically means your library path on the command line (when you are running it from unix) is different than when you are running it in control-m.
At the top of the script, before any other Perl code, add this:
BEGIN { die 'INC: ' . join("\n", @INC) }
This will immediately throw an exception containing all the library paths that perl will search to find modules.
Now run the script again in unix and in contol-m. The library include paths (contained in @INC) are likely different. control-m is likely missing one or more library paths. Any that are missing can be explicitly included:
use lib '/some/library/path';
That is the simple answer.
If you are having this problem, which is typically the case, then you have bigger environmental issues that you should resolve and for which do not have a one-size-fits-all answer. Doing the use lib
fix is a quick hack, but is not the correct way to deal with this in the long term.
Upvotes: 1