NAME

Array::Contains - Check if an array contains a specific element

SYNOPSIS

  use Array::Contains;

  if(contains($somevalue, \@myarray)) {
    # Do something
  }

DESCRIPTION

Array::Contains is a simple replacement for the most commonly used application of the (deprecated) Smartmatch operator: checking if an array contains a specific element.

This module is designed for convenience and readable code rather than for speed.

FUNCTIONS

This module currently exports its only function by default:

contains()

contains() takes one scalar and one array reference and returns true (1) if the scalar is contained in the array. contains() does NOT do recursive lookups, but only looks into the root array.

SEE ALSO

List::Util

AUTHOR

Rene Schickbauer, <cavac@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2017 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.0 or, at your option, any later version of Perl 5 you may have available.