![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Finding files relative to a moduleby hsmyers (Canon) |
on May 15, 2011 at 04:01 UTC ( #904908=perlquestion: print w/replies, xml ) | Need Help?? |
hsmyers has asked for the wisdom of the Perl Monks concerning the following question: In a module that has worked without error for a very long time, under Linux/Perl 5.8.1 I now get a warning about the following code: The quote from the PAUSE report is: Line 22 is the unless (-d $db_dir_qfn) { line. I'd check to see just what is going on, but I'm flying blind until I replicate the test environment---in other words it works fine on all other Perls and under Windows of any type since 2K. I've been pointed towards File::ShareDir and its associated modules but I found the documentation pretty much opaque (at least to me) leaving me hoping for a 'relative files for dummies' how-to. I'd certainly settle for an example based on the code fragment shown above :) Note: I should point out that I realize that this is a warning, not an error. In addition, the code still manages to work in that all of the tests that depend on the presence of the data base files all work as designed. (Yes, I'm puzzled myself as to why it works given the warning...) Update: A large single thanks to your collective wisdom. I am handicapped by the lack (for now) of a Linux box to test on. Had I one, I would have hit this with the appropriate size stick until the problem was solved. That said, I would have missed your observations and probably not have produced as accurate a solution. The observation about undef and that __PACKAGE__ was a wash point me in the correct direction. We'll see---again thanks much! --hsm "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Back to
Seekers of Perl Wisdom
|
|