Subject: | array->exists |
I may have a go at implementing this myself later, but for now filing a ticket so I don't forget.
It would be useful if arrays had an ->exists method like hashes do.
my $arr = array(qw/ foo bar /, undef);
$arr->exists(0); # true
$arr->exists(1); # true
$arr->exists(2); # true
$arr->exists(3); # false because 3 > $#$arr
I'm not sure what the ideal behaviour of $arr->exists(-1) would be.