sub with_regexp { my $largest = ""; #for every line in the file, if it's length is greater #than the current longest, and it matches the set that #is all of the caracters in the RIGHT hand, not'ed, then #it is the largest open (INFILE, ") { chomp; if (length($_) > length $largest) { #NOTICE THE ! AT THE BEGINING if (! /[^yhnujmikolp]/i) { $largest = $_; } } } close (INFILE) || die "error $!"; print "LARGEST FOUND: $largest\n"; }