Subject: | Spectrum::CLI specroot option processing |
* CLI.pm (new): check for path is (m|^/|), but $_ is not set. Given the
structure, we need to check $_[0] instead:
else { # scalar
if ( $_[0] =~ m|^/| ) { # it's an absolute path
Otherwise, the SPECROOT option is not properly checked.
Additionally, the documentation states:
SPECROOT value
You may pass a string specifying the absolute path to the
"vnmsh" directory. It should point to a directory which
contains the "vnmsh" sub-directory. (It is not necessary to
pass this argument if either the SPECROOT or SPEC_ROOT
environment variables are set.)
However, in the code, "vnmsh" is never appeneded to this value if it's
passed in via the subroutine constructor, as it is if the SPECROOT value
is read from the environment. Either "vnmsh" needs to be appended or
the documentation should be updated to indicate that the value is not
the SPECROOT, but rather the full path to the vnmsh directory.
Work-around is simply setting the environment variable for the module
to use, rather than passing it into the constructor.