I am trying to understand why the following warning is give in perldoc.
"WARNING: Calling exists on array values is strongly discouraged. The notion of deleting or checking the existence of Perl array elements is not conceptually coherent, and can lead to surprising behavior."
I am no longer doing this having swapped to using a hash with numerical keys instead. In my situation the numerical keys ($elementIndex) are not contiguous i.e 0,3,7. Checking if an element exists using if (exists $myArray[$elementIndex]) {... seemed to work as expected, so I am trying understand why this warning is given?
In reply to Using exists to check element in array by david
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |