#!/usr/bin/perl -w use strict; my %hash; my @argv; my $file = $ARGV[0]; open (IN, $file) or die "Could not open file: $!"; while (my $line = ) { my $vowels = my $w; $vowels =~ s/[^aeiou]//g; $hash {$vowels}{$w} = 1; } close(IN); foreach my $key (sort %hash) { foreach my $word (sort {$hash {$key}}) { print "$word\n"; } }