Subject: | makerandom() and "ne" operator don't cooperate. |
Something is weird about variables returned by makerandom(). Code dies if it tries a "ne" test on the resulting variable. Maybe this is PARI's fault, I don't know. Seems like something could be done to fix this.
Code to reproduce bug:
my $r = Crypt::Random::makerandom ( Size => 128, strength => 0 );
if ($r ne '')
{
print "\$r is not null\n";
}
Result:
PARI: *** unexpected character:
^-
The fix I am currently using:
if ($r =~ /^(\d+)$/)
{
$r2 = $1;
}
# then use $r2 as if it were $r ...
Environment Info:
Crypt::Random version 1.11
Math::Pari version 2.010201
Show quoted text
> perl -v
This is perl, version 5.005_03 built for i386-linux
Show quoted text> uname -a
Linux - 2.2.16-3rev1 #1 SMP Mon Aug 7 16:10:38 EDT 2000 i686 unknown