I am trying to use file:copy:recursive to move files, I want to remove the original files, but I would like to keep the directories, what did I do wrong here, the documentation for this is really confusing to me. it blew out my entire directory tree, I just want to move the files. I guess I should have used fmove but I don't understand this doc at all. can someone say this in english I don't get it, I read 3 or 4 times it doesn't make any sense all I get is blah blah blah. fcopy() This function uses File::Copy's copy() function to copy a file but not a directory. Any directories are recursively created if need be. One difference to File::Copy::copy() is that fcopy attempts to preserve the mode (see Preserving Mode below) The optional $buf in the synopsis if the same as File::Copy::copy()'s 3rd argument returns the same as File::Copy::copy() in scalar context and 1,0,0 in list context to accomidate rcopy()'s list context on regular files. (See below for more info)??
use File::Copy::Recursive; use File::Find; use File::Copy; #use strict; $Verbose; my $srcdir='c:\\inetpub\\performancetesting\\output\\new\\mlx\\'; my $destdir='c:\\mlx\\'; File::Copy::Recursive::dirmove $srcdir, $destdir or die "Copy failed: +$!"; print "done copying";

In reply to move files without blowing out directories by grashoper

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.