Subject: | shift offset and plain fetch |
Date: | Sat, 05 Jun 2010 08:58:31 +1000 |
To: | bug-Math-Prime-TiedArray [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With Math::Prime::TiedArray 0.04 the program foo.pl below prints
2
3
5
2
where I hoped the last number would be 7, since that's the next prime
after shifting off the first 3, the same as it would be from an ordinary
untied array.
use strict;
use warnings;
use Math::Prime::TiedArray;
tie my @primes, "Math::Prime::TiedArray";
print shift(@primes), "\n";
print shift(@primes), "\n";
print shift(@primes), "\n";
print $primes[0],"\n";