in reply to Re: If
in thread If doesn't work

First, you should always check to make sure the open worked:

open(FILE, $query->param('name')) or die "Can't open file";
Actually, I would not open any file directly from user input. Others may disagree in this case, but I would validate that param('name') is something you expect, likely /^\w+$/, or something similar.
If you had warnings turned on (which you should, -w) you would see that @file[1] is better written as $file[1]. You may want to consider putting all the HTML you are printing in a here doc, what you have is pretty hard on the eyes. As for why they do not match, you may want to chomp() the line you get from the file. If the file only contains one line, you should use this:

open(FILE, $name) or die "Can't open $name"; $pass = <FILE>; close FILE; chomp $pass; if ($query->param('pass') eq $pass) { ...etc...

Cheers,
KM