RSCHUPP via RT wrote:
Show quoted text>why do you think that "if (%hash) { ... }" isn't "well-behaved"?
I'm mildly surprised to see that it's documented to behave the way you
expect, because I'd got the impression that that wasn't really intended
until pretty recently. Seems to be osmotic knowledge to the effect that
hash in scalar context has variable behaviour, and I didn't question
that when I found it empirically misbehaving. But on now looking more
closely, I have a much more precise answer for you.
In 5.8.2, there is a specific bug in the handling of hash-as-scalar for
tied hashes. The nature of the bug is that the scalarification looks at
the underlying hash, ignoring the tie magic. So if you started with an
empty hash, as you almost always would, the hash in scalar context would
return false regardless of what the tie magic claims is in the hash.
%Config::Config is tied. The bug is fixed in 5.8.3, as described in
perl583delta.
Show quoted text>Also, could you be a little more specific about actual failures
>caused by the "... if %Config::Config"?
With the condition always being false (on 5.8.2), $dl_ext there ends up
being undef. When that gets used as part of the generated filenames
to look at, it means that all the filenames considered are wrong, so
_dl_mod2filename() never finds any of the .so files. Those files are
therefore missing from the output of scan_deps_runtime(). This gets
picked up in t/7-check-dynaloader.t:
$ PERL5LIB=$PWD/blib/arch:$PWD/blib/lib perl -w t/7-check-dynaloader.t
1..3
ok 1 - Path for Cwd.pm or File/Glob.pm found
not ok 2 - we have some key that looks like it pulled in the Cwd or Glob shared lib
# Failed test 'we have some key that looks like it pulled in the Cwd or Glob shared lib'
# at t/7-check-dynaloader.t line 37.
Use of uninitialized value in substitution (s///) at t/7-check-dynaloader.t line 40.
Use of uninitialized value in hash element at t/7-check-dynaloader.t line 42.
Use of uninitialized value in hash element at t/7-check-dynaloader.t line 42.
not ok 3 - the full bundle path we got looks legit
# Failed test 'the full bundle path we got looks legit'
# at t/7-check-dynaloader.t line 42.
# got: undef
# expected: '/home/zefram/usr/perl/perl_install/perl-5.8.2-i32-f52/lib/5.8.2/i386-linux-thread-multi/'
# Looks like you failed 2 tests of 3.
-zefram