while (my $words = ) { chomp $words; push @matches, $words if $words =~ /a$/ }