Link to home
Start Free TrialLog in
Avatar of khanzada19
khanzada19

asked on

Can't locate Win32/Service.pm in @INC (@INC contains:

I am trying to use same perl script both on Windows and Unix enviornment, it works on windows fine but I get below error on Unix

Can't locate Win32/Service.pm in @INC (@INC contains: /home/s/lib /usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2 /usr/opt/perl5/lib/site_perl .) at test.pm line 25.
BEGIN failed--compilation aborted

on test.pm at line 25 I have this entry
use Win32::Service;

I have to comment out above line in order to make it work on Unix, is there a way that I could run the same perl script with having 2 verions (windows and Unix) of it?
I would appreciate your help
ASKER CERTIFIED SOLUTION
Avatar of Morcalavin
Morcalavin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's worth noting that Win32::Service is only going to work on windows systems, so if you try to make use of it in unix it's going to croak.
Avatar of Adam314
Adam314

The code for Morcalavin will let your script run, but there will likely be other errors if you use any functions from the Win32::Service module.

What is it that the script does on windows?  What do you want it to do on unix?
What windows calls services are what unix calls daemons.  Do you want to monitor a daemon process?