in reply to open fails to open file when filename read from STDIN

There's a newline on the end of the filename, which you need to get rid of. Also, always error-check your opens.
my $file = <STDIN>; chomp $file; open my $handle, '<', $file or die "Can't read $file: $!";