user FindBin perl module to find lib/sbin, remove use of ENV to pass around global variables

Create issue
Issue #2303 resolved
Roland Haas created an issue

Currently the scripts in lib/sbin assume that they are called from the Cactus root directory and assume that “$PWD/lib/sbin” is the location of the perl modules and scripts.

Since the scripts themselves reside in there, a better way is to use Perl’s FindBin module which let’s one find the location of the current script.

Further this lets one avoid using ENV{“TOP”} to pass around the Cactus root only to find “lib/sbin” inside of it or to find the piraha “.peg” files (which are located i “lib/sbin/../src/peg/”.

The pull request is here:

https://bitbucket.org/cactuscode/cactus/pull-requests/69/rhaas-perl-inc/diff

It is rather long so it may be best to have a look at the individual commits:

https://bitbucket.org/cactuscode/cactus/pull-requests/69/rhaas-perl-inc/commits

which try to group the chances into logical pieces.

Comments (3)

  1. Log in to comment