if ( param('select') ) { #If user selected an item from the drop down menu unless( grep /^\Q$article\E$/, @menu_files ) #Unless user selection doesn't match one of the valid filenames within @menu_files ......}} print param('select'), ' - ', length( param('select') ), br() x2; foreach( @menu_files ) { my $match = ($_ eq param('select')) ? "matches" : "fails to match"; print $_, ' - ', length( $_ ), ' - ', $match, br; } Encode::from_to($article, 'utf8', 'ISO-8859-7'); open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/text/$article.txt" or die $!; ........