aboutsummaryrefslogtreecommitdiff
path: root/challenge-279/e-choroba/perl/ch-2.pl
blob: f1080bfbe943a00dc4c9ae8594b94714f73fb76f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use warnings;
use strict;
use experimental qw( signatures );

sub split_string($string) {
    my $tally = $string =~ tr/aeiou//;
    return 0 == $tally % 2
}

use Test::More tests => 3;

ok ! split_string('perl'),         'Example 1';
ok   split_string('book'),         'Example 2';
ok   split_string('good morning'), 'Example 3';