I know about chomp and I'm pretty sure that's not the problem, since I already tried that ;)
It also wouldn't explain why writing it with parentheses does work. But thanks anyway!
Matje
Comment on Re^4: problem with string substitution output
So where does your newline in the file name come from? Use Data::Dumper to investigate.
If the three-argument form of open (open my $handle, $mode, $filename;) bails out it's not open's fault - you provided the wrong inputs. If you don't believe it, print the file name before:
use Data::Dumper;
print "Trying to open file this file: ", Dumper($file);
open my $f, '<', $file or die ...;