#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use open qw/:std :utf8/;
my $text = "Как найти слова с двумя гласными?";
my @words = split /\s+/, $text;
my ($count, @result, $tmp_word);
for my $word (@words) {
$tmp_word = $word;
$count = ($word =~ s/[уеёыаоэяию]//g);
push @result, $tmp_word if $count == 2;
}
for (@result) {
print $_, "\n";
}