my $s = 'the quick brown fox jumps over the lazy dog'; my $vowels = () = $s =~ m[[aeiou]]g; print "There are $vowels vowels in '$s'"; There are 11 vowels in 'the quick brown fox jumps over the lazy dog'