When you do a use, @INC is checked from the directory you execute the script in, not the directory the script is located. Hence, I would do an full directory in your use lib, in the form:
use lib '/my/directory/with/Ops/in/it';
use Ops;
That way, you'll be able to call your script from anywhere.
------ We are the carpenters and bricklayers of the Information Age. Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. | [reply] [d/l] |
I'll be the first to admit that I don't know a lot about modules, especially writing your own. But it sounds to me like maybe you have a problem with the current working directory when you run your script. I'm wondering if, since you call the script from /root, it doesn't look for the Ops directory in /root (/root/Ops). Just out of curiosity, if you create the /root/Ops folder and stick that module in it, does it work?
| [reply] |