in reply to Re^2: Stuck Value
in thread Stuck Value
update: and to avoid trying to index below 0: and suggesting an inequality function:$arr[ ($i - 4) .. $i ]
my $h = $i - 4; if ( $h >= 0 ) { if (unequal ( $arr[ $h .. $i ] ) { # flag stuck value } } # ... sub unequal { my %v = map { ($_, 1 ); } @_; my @v = keys %v; return $#v; }
One world, one people
|
|---|