in reply to a lil help on file extension

What the others pointed out so far were correct solutions of the problem, but I suppose you would like to know what went wrong with your code.
Assume that the file does not end in .html; then $file_names !~ /\.html$/ evaluates to true. The or statement is now definitely true, because one of its arguments is true, so that the if-block is executed.
What you meant probably was  if ( $file_names !~ /\.html$/ and $file_names !~ /\.htm$/ ). Try it; it should work for you.