in reply to Path relative to package

I also know that the path is available in @INC (via use lib...). But I don't know how to get the correct one from here.

Using DBI.pm as an example of a file to find:

#!/usr/bin/env perl use strict; use warnings; my ($path) = grep { -f "$_/DBI.pm" } @INC; print $path;

Not absolutely the most efficient, but it will work.