my @files = glob "$ENV{'DOCUMENT_ROOT'}/data/text/*.txt"; my @display_files = map m{([^/]+)\.txt}, @files; Encode::from_to($_, 'ISO-8859-7', 'utf8') for @display_files; if ( param('select') ) { #If User selected an item from the drop down menu unless ( grep { $_ eq param('select') } @display_files ) #If User Selection doesn't match one of the passages then its a Fraud! { ...