- or download this
my ($idx, @array, $a_big_num, $some_data);
...
# Fetch the data
$idx = map_func($a_big_num);
$some_data = $array[$idx];
- or download this
my (%hash, $a_big_num, $some_data);
...
# Fetch
$some_data = $hash{$a_big_num};
- or download this
sub map_func { return 7 }
- or download this
sub map_func {
state %indexes;
...
die "Ran out of slots!" if keys %indexes > 1000;
return $indexes{$a_big_num}=$idx++;
}