# Checks if a provided element exists in the provided list # Usage: isInList # Returns: 0/1 sub isInList { my $needle = shift; my @haystack = @_; foreach $hay (@haystack) { if ( $needle eq $hay ) { return 1; } } return 0; }