use strict; use warnings; open my $fh, '<', 'c:\Directory with too many spaces\filename contains spaces too.txt' or die "Cannot open file"; print while (<$fh>);