hi,
Today I had a rather awkward need. Inside a module I had to get a resource which was in directory relative to the module..hmm
After some thinking i got to this idea
(my $pkgdir = __PACKAGE__) =~ s!::!/!; my ($path) = $INC{"$pkgdir.pm"} =~ m!^(.+)/!; print $path;
I thought it will be usefull so I post it here..hth

Replies are listed 'Best First'.
Re: get absolute path of the module inside it
by merlyn (Sage) on May 18, 2007 at 12:36 UTC
      SWEET! This is exactly what I needed. So funny, I thought, there has to be a way to do this in perl. My need is to find a corresponding config file relative to where the perl module is installed. Thank You! -Steve