Perl.pm: use 'first' to check for array membership.

This makes the existence checking somewhat faster as you can stop
checking once you have a match.

Checked the rest of the codebase and didn't see any other places where
this happens.

Thanks to @killerfish for letting me know `List::Util` was in core now.