Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Including text files in Modulesby Miguel (Friar) |
on Nov 04, 2004 at 17:51 UTC ( [id://405236]=perlquestion: print w/replies, xml ) | Need Help?? |
Miguel has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed Monks,
Is there any simple and practical way to include txt files in a module? This is my problem: I have a package named Foo::Foo1::Foo2::FooPackageName This reads 3 text files (data sources)
Now, when I do a perl Makefile.PL, make, make test and make install everything runs fine. (The MANIFEST also includes those 3 files) Then, I can see the files in the right directory (/usr/lib/etc...) But, when I try to run some program using that module it complains about not getting the files. What am I doing wrong or missing here?
---------------- UPDATE ----- Maybe I wasn't clear enough before.
Q1. Is it possible to include txt files (as data sources) inside a Perl package? (not to dump the contents as some kind of variables; the idea is to keep those files intact) Q2. How do I do that in a portable way? this is, no matter what system is running the module, those files are always accessible (probably in the same directory where the module is) ------------------ UPDATE ----- Miguel
Back to
Seekers of Perl Wisdom
|
|