I need a simple way to know the needed path to a package.
Let's say I have a full path file "/my/directory/Dogs/Mooma.pm". The package in this case is "Dogs::Mooma".
I want a simple way to know that @INC should have "/my/directory/" in it and not "/my/directory/Dogs/".
I can open the file, grep for "^package\s+(\S+)", replace :: with / and fix the path I have, but I rather use an existed code, something that is already optimized (I need to do it on thousands of files…).