Attempts to install module on the system on which Bytes::Random::Secure

was installed ended up with:

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/run.t .. 1/?
#   Failed test 'open a pwsafe3 database'
#   at t/run.t line 36.

#   Failed test 'read a pwsafe3 database and change a record (Undefined subroutine &Crypt::PWSafe3::random_bytes called at /home/marcink/.cpan/build/Crypt-PWSafe3-1.06-qScJdO/blib/lib/Crypt/PWSafe3.pm line 56.
# )'
#   at t/run.t line 66.

(and more such errors).
This commit is contained in:
Marcin Kasperski
2012-11-19 21:50:24 +01:00
parent 3d80bb1608
commit 65856ec811

View File

@@ -34,7 +34,10 @@ use Crypt::PWSafe3::SHA256;
# install a wrapper closure around the # install a wrapper closure around the
# one we found. # one we found.
BEGIN { BEGIN {
eval { require Bytes::Random::Secure }; eval {
require Bytes::Random::Secure;
Bytes::Random::Secure->import("random_bytes");
};
if ($@) { if ($@) {
# well, didn' work, use slow function # well, didn' work, use slow function
eval { require Crypt::Random; };# qw( makerandom ); }; eval { require Crypt::Random; };# qw( makerandom ); };