in reply to Filename Surrounded by Quotes in a Scalar Variable Causes Open to Fail
#!/usr/bin/perl use strict; use warnings; my $temp_file = $ENV{'APPDATA'} . '\test file name.tmp'; #$temp_file = '"' . $temp_file . '"'; # not needed, because open() isn +'t bothered by spaces in the name print "|$temp_file|\n"; open(my $fh, '>', $temp_file) or die "Error opening $temp_file $!\n"; print "worked!\n";
except for the following ... reserved characters: ...... thus indicating that quotes are not part of the filename, because they are not allowed
* " (double quote)
...
|
|---|