in reply to How to include a lot of files in a module?

Is the problem you're stuck on how to figure out what directory My::Module is in, so you can find other files relative to it?

If so, look at the %INC variable, specifically at $INC{'My/Module.pm'}. Here's a small sample:

package t63; use File::Basename; my $incpath = __PACKAGE__.".pm"; $incpath =~ s/::/\//g; our $dir = dirname($INC{$incpath})||'.'; print "Dir: $dir\n"; 1;

You might also want to look at the FindBin module, since it does almost what you want but not quite.

Replies are listed 'Best First'.
Re^2: How to include a lot of files in a module?
by Miguel (Friar) on Jul 15, 2006 at 10:36 UTC
    That was may problem. Thank you. Everything works now.