in reply to Testing filehandles

In the first place, eq is the string equality operator (!= is numeric). In the second place, the result of <STDIN> won't be automatically assigned to $_ because it is part of a more complex expressions (see "IO Operators" in perlop).