Skip Menu |

This queue is for tickets about the Crypt-Random CPAN distribution.

Report information
The Basics
Id: 443
Status: resolved
Priority: 0/
Queue: Crypt-Random

People
Owner: VIPUL [...] cpan.org
Requestors: bobo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.11
Fixed in: (no value)



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
makerandom returns a pari integer type that should be compared with == and != The correct test would be if ($r != 0) { do stuff } cheers, vipul. [guest - Wed Apr 3 14:16:26 2002]: Show quoted text
> Something is weird about variables returned by makerandom(). Code > dies if it tries a "ne" test on the resulting variable. Maybe
this Show quoted text
> 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 >
> > perl -v
> > This is perl, version 5.005_03 built for i386-linux >
> > uname -a
> Linux - 2.2.16-3rev1 #1 SMP Mon Aug 7 16:10:38 EDT 2000 i686 unknown