Opened 3 years ago
Last modified 3 years ago
#80 new task
Settle on a method to find internal libraries
Reported by: | Kris Deugau | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Version: | Keywords: | ||
Cc: |
Description
With recent-ish Perl releases, "." was justifiably removed from @INC.
This used to mostly work to keep scripts with library modules working when plonked down on some arbitrary path, but wasn't entirely reliable.
Strictly hardcoding a path works fine for any one given installation, but doesn't work well for code expected to be portable or easily moved elsewhere within a single system.
Some searching led to FindBin, applied in r797. However, after encountering a tainting issue with that fix, further searching led to https://www.perlmonks.org/?node_id=585299 and https://www.perlmonks.org/?node_id=41213, pretty clearly indicating that while FindBin basically worked, it a) did a lot of unnecessary work and b) largely succeeded by accident.
The second link led to the "scriptname" module, however on closer inspection it checks the script name for a handful of file extensions - which doesn't include several used by DNSAdmin. Also, this code is expected to run on some Truly Ancient(TM) systems on which it would be a pain to get said module properly installed.
In 834: