We had recently a discussion covering this, see Re^3: extracting a list element ( 'delete @array' explained) and connected thread.
> In my situation the numerical keys ($elementIndex) are not contiguous
Personally I think if you really know what you are doing, you should just silence this warning.
NB: But sparse arrays with gaps of non-existing elements are normally more efficiently implemented with hashes.²
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
¹) and because Data::Dumper is kind of lying about non-existing elements.
²) and hashes have the advantage that the number of existing keys is readily available. The length of an array with gaps OTOH is of no help, especially because after a delete all non-existing entries will be truncated from the end.
In reply to Re: Using exists to check element in array
by LanX
in thread Using exists to check element in array
by david
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |