in reply to Move all files and folders older than 5 minutes

File::Copy will handle the moves for you. So, what happens when you run your script?

Dum Spiro Spero
  • Comment on Re: Move all files and folders older than 5 minutes

Replies are listed 'Best First'.
Re^2: Move all files and folders older than 5 minutes
by omegaweaponZ (Beadle) on May 01, 2015 at 14:32 UTC
    I get problems when I try to copy the directory, doesn't seem to be able to handle it. I'll need the directory structure to stay intact from one folder to the other. Copy failed: Is a directory

      Perhaps look into File::Copy::Recursive? It handles directories as well as files, but I don't know that it will let you specify which files it copies. But the pathmk() method might be useful to you.

      Dum Spiro Spero
        Bingo, much better capabilities on that here.
        rmove($move_file,$new_file) or die "Copy failed: $!";
        Thank you!