C<not> should be C<!> in pwent.t, to fix a precedence bug.
Fortunately the effects are mostly benign. There are two boolean conditions -
$where defined, and PerlIO available, making 4 possible combinations. As was,
the code was:
if (not defined $where && $Config{useperlio} eq 'define') {
...
if (-x '/usr/bin/dscl') {
...
if (open (PW, '<', \$data)) {
$where = ...;
would enter the first if block for 3 out of 4 possibilities, skipping only if
*both* $where as defined *and* PerlIO was available. This was not the intent.
However, if PerlIO is unavailable, then the open will fail, $where won't be
set, and the logic continues on below, falling back to /etc/passwd
The intended logic is
if (!defined $where && $Config{useperlio} eq 'define') {
...
ie only enter on 1 of the 4 possibilities - skip unless $where was undefined
and PerlIO was available.
The net effect was that usually the behaviour was the same. The only difference
will be if PerlIO is not available (not the default, and rarely changed),
the password data *is* available from one of the services tested earlier, and
an /usr/bin/dscl executable is present.
In this case, the old code would have reached the open, which would have
failed, but would have closed PW as a side effect. However, because $where
would be defined, the fallback to /etc/passwd would not have been tried.
This would have caused the regression test to fail.
Also, the test C<$Config{useperlio} eq 'define'> is not quite correct, as
$Config{useperlio} will be undef if PerlIO is disabled, and the eq will warn.