in reply to Including text files in Modules
Find out where FooPackageName was loaded from, and then use this information as a base for finding your text files:
use Foo::Foo1::Foo2::FooPackageName; my $file = "file.txt"; my $path = $INC{"Foo/Foo1/Foo2/FooPackageName.pm"}; $path =~ s/FooPackageName.pm/$file/; print "Full path to $file: $path \n";
(I use this inside the Inline::Parrot module, in order to find out where the "pir" files were installed)
|
|---|