• Recherche d'une occurence dans un tableau
It depends on what you want the search to do:

if you want to find all matches, use the built-in grep:
 my @matches = grep { /pattern/ } @list_of_strings;

if you want to find the first match, use first in List::Util:
 use List::Util 'first';
 my $match = first { /pattern/ } @list_of_strings;

if you want to find the count of all matches, use true in List::MoreUtils:
 use List::MoreUtils 'true';
 my $count = true { /pattern/ } @list_of_strings;

if you want to know the index of the first match, use first_index in List::MoreUtils:
 use List::MoreUtils 'first_index';
 my $index = first_index { /pattern/ } @list_of_strings;

if you want to simply know if there was a match, but you don’t care which element it was or its value, use any in List::MoreUtils:
 use List::MoreUtils 'any';
 my $match_found = any { /pattern/ } @list_of_strings;
  • Lister les doublons ou les uniques dans un tableau
my %seen;
my @doublons = grep {++$seen{$_}==2} @liste

my %seen;
my @unique = grep {++$seen{$_}==1} @liste