in reply to Re^4: problem with string substitution output
in thread 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 ...;