One more comment
Also I can test if the file exists, using the variable, -e $fnmi and I get true.
Its not obvious from your code where this variable comes from, but the existance of a variable and the contents are two different things. You'll get more mileage with something like:
if ( $fnmi eq 'someword' ) { # do stuff }
if ( $fnmi =~ /^someword$/ ) { # do stuff }
Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."--
--Ralph Waldo Emerson