Your code produces your desired output on my machine under NT/AS 5.6.1 using the standard shell.
Not sure quite what this shows, except that maybe you are running your code under the auspices of cygwin or 4NT maybe? I which case, you may need to look at the quoting rules for that environment. If not, it could be that they changed the rules for Win2K, which would be no surprise.
c:\test>type temp.pl #! perl -sw use strict; my $filename = 'This_filename_has_2 2_spaces.txt'; my $tempstr = "echo \"$filename\" |"; printf "Below is the output of \'$tempstr\'\n"; open (IN,$tempstr) or die "Failed to echo $filename!\n"; printf "\t"; printf <IN>; close (IN); c:\test>temp.pl Below is the output of 'echo "This_filename_has_2 2_spaces.txt" |' "This_filename_has_2 2_spaces.txt" c:\test>
Examine what is said, not who speaks.
In reply to Re: consecutive spaces in piped open
by BrowserUk
in thread consecutive spaces in piped open
by Woodya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |