foreach my $str ("one", "two", "three") { if ($str =~ /^t/) { print "'$str' starts with 't'\n"; } else { print "'$str' does not start with 't'\n"; } }