$|=1; # So it works in the IDE

@s = qw /freddy frddd fred red ed free freed/;

foreach $e (@s){
  if ($e=~ /fre?d/){       # alternatives would be: /fr.d/ or /f..d/
    print "$e matches!\n";
  }
  else {
    print "$e doesn't match!\n"
  }
}
