Hello AtlasFlame,

here you are mixing two problems: path with spaces AND path separator.
With ugly path with spaces you need double quotes around the whole path:
dir "C:\Local Publish\images" #OK
So if you need to pass such a string with doublequotes untouched, for example inside a sigle quote string you need to escape (with '\') all occourences of " you want to be passed unaltered, as in:
perl -e " $dir = '\"C:\Local Publish\images\"'; system qq(dir $dir )" + #OK
As personal suggestion avoid to create and use paths with spaces, is a very stupid 'feature'.

Now the path separator part. As far as i know, you can use both '\' and '/' as path separator in windows. This is handy because the '\' happens to be the escape char in Perl. In the command prompt you can safely use:
dir "C:/Local Publish/images" #OK
So you can safely do the same in a Perl program:
perl -e " $dir = '\"C:/Local Publish/images\"'; system qq(dir $dir )" + #ok
If you need to interpolate some var inside such strings you need the concatenation operator (the dot '.'):
perl -e " $img = 'images';$dir = '\"C:/Local Publish/'.$img.'\"'; syst +em qq(dir $dir )"
You can use this post as explaination of quotes in Perl and the docs as base rference. Read also the usage hints on windows especially using Perl from command line.

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^3: how to dir a directory that have space by Discipulus
in thread how to dir a directory that have space by AtlasFlame

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.