in reply to Re: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!
in thread “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!!
Changedto:my $nextidx = $asize / 2; my $nextinc = $nextidx / 2;(Otherwise, for an array of 5 elements, it’d return an index = 2.5 ;-...)).my $nextidx = int($asize / 2); my $nextinc = int($nextidx / 2);
Actually, that change is unnecessary. Whenever a floating point value is used as an array index, Perl automatically uses just the integer part of the value, since that would be the only sensible thing to do.
In Section
Seekers of Perl Wisdom