in reply to Variable fails where absolute path does not
It's also possible you have a trailing newline on your filename. Try:
use Data::Dumper; $Data::Dumper::Useqq=1; print Dumper($file); [download]