my $newDir = "\"${menu}$CGIFORM::group\\\"";
print $newDir,"\n";
print "Doesn't exist ",(! -d {newDir}),"\n";
print " Does exist ",( -d {newDir}),"\n";
exit;
Produces:
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PhoneTools\"
Doesn't exist 1
Does exist
However:
$ls -al "C:\ProgramData\Microsoft\Windows\StartMenu\Programs\PhoneTool
+s\"
total 36
drwxr-xr-x 1 Joe None 0 Mar 8 12:28 .
drwxr-xr-x 1 Joe None 0 Mar 8 12:27 ..
-rwxr-xr-x 1 Joe None 850 Mar 8 12:28 Ac32.exe.lnk
$dir "C:\ProgramData\Microsoft\Windows\StartMenu\Programs\PhoneTools\"
Volume in drive C is OS
Volume Serial Number is FA69-4ADC
Directory of C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Pho
+neTools
03/08/2012 12:28 PM <DIR> .
03/08/2012 12:28 PM <DIR> ..
03/08/2012 12:28 PM 850 Ac32.exe.lnk
1 File(s) 850 bytes
2 Dir(s) 652,128,382,976 bytes free
Update:
It was the extra quote at each end of the string that was the problem. I accidentally deleted the $ when I prettied up the code for posting.
I just couldn't see my mistake.