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.


In reply to -e fails when file is proven to exist by zemplen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.