my @list = qw(a list of words); for my $w (@list) { if($w =~ /^[aeiou]/) { $w = "$w: begins with a vowel"; } else { $w = "$w: begins with a consonant"; } print $w, $/; } __output__ a: begins with a vowel list: begins with a consonant of: begins with a vowel words: begins with a consonant