in reply to Shortest -return index of element in array- sub
Or maybe this:
sub indexArray{ while (@_) { return @_-1 if $_[0] eq pop } }
John.
--
Update: Just saw ChOas' post.
In Section
Cool Uses for Perl
in reply to Shortest -return index of element in array- sub
sub indexArray{ while (@_) { return @_-1 if $_[0] eq pop } }