I was attempting to copy a directory on windows with the dircopy subroutine of module File::Copy::Recursive. However whenever I run the program it claims the directory does not exist. For my code:

} else { print "\nAll songs found matches! ^_^ \n";} print "Copying Files....\n\n"; print "0% 100%\n"; my $div; {use integer; $div=(scalar keys %moves) / 25 + 1 ;} my $i = 0; foreach $dir (keys %moves) { unless (defined $opt{s}) {dircopy("$dir","$moves{$dir}") or die("\ +n!: Couldnt copy \"$dir\" : $!\n");} print "." if (($i % $div) == 0); $i++; }

i get:
All songs found matches! ^_^ Copying Files.... 0% 100% !: Couldnt copy "C:\Program Files\Stepmania CVS\Songs\Dance Dance Revo +lution 5th Mix\Abyss" : No such file or directory

%moves is generated dynamicly so I thought I might have messed up the generation routine. To check I added the lines:

... unless (defined $opt{s}) { print "it exists\n" if (-e $dir); #here print "its a dir\n" if (-d $dir); #and here dircopy("$dir","$moves{$dir}") or die("\n!: Couldnt copy \"$di +r\" : $!\n"); ...

to which I recieve:
... All songs found matches! ^_^ Copying Files.... 0% 100% it exists its a dir !: Couldnt copy "C:\Program Files\Stepmania CVS\Songs\Dance Dance Revo +lution 5th Mix\Abyss" : No such file or directory

What am I doing wrong? If the fault is with the module being none m$ compatible what should I use in its place?

Thanks In Advance, ~Phoenix9

Janitored by Arunbear - replaced pre tags with code tags, to prevent distortion of site layout.


In reply to SOLVED:Copy a directory on windows by phoenix9

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.