aboutsummaryrefslogtreecommitdiff
path: root/challenge-279/atschneid/perl/ch-2.pl
blob: 6fbeb7b33a7bdaaa04cb67819c5fe81bd0c5b81b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;

use v5.38;

my @inputs = (
    "perl",
    "book",
    "good morning",
    "hello",
    "heloOlo",
    "heloeOlo"
    );
for (@inputs) {
    say $_ . " => " . ( splittable_string($_) ? "true" : "false" );
}

sub splittable_string( $string ) {
    my @count = $string =~ /[aeiou]/gi;
    return $#count % 2;
}