The Weekly Challenge - 319

TASK #1: Word count
You are given a list of words containing alphabetic characters only.

Write a script to return the count of words either starting with a vowel or ending with a vowel.

#!/usr/bin/perl
use strict;
use warnings;

sub word_count {
    my ($words_ref) = @_;

    # Count words that start OR end with a vowel (case-insensitive)
    scalar grep { /^[aeiou]|[aeiou]$/i } @$words_ref;
}

# Tests
printf "%d\n", word_count(["unicode","xml","raku","perl"]); # 2
printf "%d\n", word_count(["the","weekly","challenge"]); # 2
printf "%d\n", word_count(["perl","python","postgres"]); # 0
printf "%d\n", word_count(["Apple","Blue","Orange","Sky"]); # 3