Help for this page

Select Code to Download


  1. or download this
    ## discover if an array contains a value, using grep
    sub contains {
    ...
       
       return $cnt ? 1 : 0;
    }
    
  2. or download this
    ## discover if an array contains a value, using List::Util::indexes;
    sub contains {
    ...
       
       return $cnt ? 1 : 0;
    }