sub without_regexp { my $largest = ""; #create my set my %set = ( ); foreach (qw( y h n u j m i k o l p )) { $set{$_} = 1; } #open file, and for every word that is input, if it's #longer than the current longest, for every character, if #it is in the set, jump out, otherwise, if all characters #are NOT in the set (the word had none of the offending #letters), then make it the largest... open (INFILE, ") { chomp; if (length($_) > length $largest) { if (! scalar grep { $set{$_} } split('', lc($_))) { $largest = $_; } } } close (INFILE) || die "error $!"; print "LARGEST FOUND: $largest\n"; }