use warnings; use strict; my %umlautWords; my $umlautWordPattern = qr( [aou]e )ixo; for my $file ( glob( 'C:/myPath/*.txt' ) ) { my $data; open( my $FH, '<', $file ) or next; { local $/; $data = <$FH>; } close $FH; while ( $data =~ / \b (\w+) \b /oxg ) { my $word = $1; if ( $word =~ $umlautWordPattern ) { next if exists $umlautWords{ $word }; $umlautWords{ $word } = 1; } } print "$file completed\n"; } print "$_\n" for ( sort { uc( $a ) cmp uc( $b ) } keys %umlautWords );