http://www.perlmonks.org?node_id=217520


in reply to (tye)Re: How to make a module aware of where it is installed?
in thread How to make a module aware of where it is installed?

Ah ok I misunderstood. This makes my Makefile.Pl marginally simpler, but still doesn't solve the problem of the module itself knowing where it is installed.

--
જલધર

  • Comment on Re: (tye)Re: How to make a module aware of where it is installed?

Replies are listed 'Best First'.
(tye)Re2: How to make a module aware of where it is installed?
by tye (Sage) on Dec 04, 2002 at 16:43 UTC

    If your module is called Foo::Bar, then $INC{"Foo/Bar.pm"} will give you the full path to your Bar.pm file. Or you could use __FILE__ for the same thing. Then use File::Basename and/or File::Spec (see also File::Spec) to get the path of just the directory.

            - tye

      Yep. that's what I do now based on atcroft's suggestion.

      --
      જલધર