正则表达式程序不打印

cod*_*NOT 3 regex perl

我正在尝试从文件中读取数据并按顺序打印包含所有小写元音('a','e','i','o','u')的单词(每行一个).他们不需要彼此相邻

#!/usr/local/bin/perl
#$data_file = "words.txt;
open (MYFILE, $data_file) or die "can't find file - $!";

while (<MYFILE> =~ m/.*a.*e.*i.*o.*u.*/i)
{
    print "$_";
}

close(MYFILE);
Run Code Online (Sandbox Code Playgroud)

它不打印任何东西:/

Ale*_*lec 6

问题不是正则表达式,而是如何使用文件句柄,试试这个:

while (<MYFILE>) {
    print if /.*a.*e.*i.*o.*u.*/i;
}
Run Code Online (Sandbox Code Playgroud)