@s = ("wilma", "barney", "Mrs. Wilma Flintstone", "wilma&fred");

foreach $e (@s){
  if ($e =~ /a\b/){       # the \b defines the end of a word
    print "$e matches!\n";
  }
  else {
    print "$e doesn't match!\n"
  }
}
