in reply to Array: inserting what isn't there
Instead of having "$i.found" or "$i.lost", why not just make the array value true or false and index it by $i. The 0th element will be useless, but don't worry about it:
my @array; foreach my $i (1 .. $SOME_BIG_NUMBER) { $array[$i] = 1 if found($i); }
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|