You could avoid that problem by assigning the index to the first undef slot, rather than straight incrementing:
my $instance_index = List::Util::first { !defined $_ } @name;
You end up, though, with an O(n) constructor. But perhaps the savings in access make up for this.
In reply to Re^4: inside-out objects using arrays?
by fishbot_v2
in thread inside-out objects using arrays?
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |