Advertisement

03.17.2008 at 07:32AM PDT, ID: 23247104
[x]
Attachment Details

using File::Copy in Perl to move multiple directories

Asked by texasreddog in Perl Programming Language

It is much easier to use a system call to mv to move multiple files/directories, but I want to use the Perl module File::Copy to accomplish this.  Basically, I need to move the contents of the directory I'm in up to the parent directory.  From what it looks like, you can't just use * wildcards like you can with the system mv call.  You have to specifically say which directory source goes to which target source.  So I'm guessing that I have to get an ls listing of my current directory contents to read through, and then perform a move call on them.  Can someone give me a quick code snippet to do this in Perl with File::Copy.  Or if there is a way to do this with wildcard substitution, that would be even better.  thanks!Start Free Trial
 
Loading Advertisement...
 
[+][-]03.17.2008 at 11:01AM PDT, ID: 21144553

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: FishMonger
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.25.2008 at 07:33AM PDT, ID: 21202258

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628