$|=1; # So it works in the IDE

@s = qw /Fred frederick Alfred/;

foreach $e (@s){
  if ($e =~ /fred/){       # here we check the pattern
    print "$e matches!\n";
  }
  else {
    print "$e doesn't match!\n"
  }
}
