I know that this doesn't technically answer your question - but wouldn't this be easier using a hash?
use strict; my %h = (); $h{$_}=1 for (0 .. 100); while(1) { print "choose a number: " . join(",",sort { $a <=> $b } keys %h,"q") . "\n"; my $in = <STDIN>; chomp $in; if ($in eq "q") { last; } delete $h{$in}; } print "remaining: " . join(",", sort { $a <=> $b } keys %h) . "\n";
In reply to Re: popping, shifting or splicing an array???
by jch341277
in thread popping, shifting or splicing an array???
by drock
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |