Skip to content

Instantly share code, notes, and snippets.

@garethflowers
Created June 3, 2013 11:35
Show Gist options
  • Select an option

  • Save garethflowers/5697583 to your computer and use it in GitHub Desktop.

Select an option

Save garethflowers/5697583 to your computer and use it in GitHub Desktop.
"inarray.pl" - checks if an array contains a `value`
sub inarray
{
my ( $value, @array ) = @_;
foreach my $arrayvalues ( @array )
{
foreach my $arrayvalue ( @$arrayvalues )
{
if ( $arrayvalue eq $value )
{
return 1;
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment