in reply to Re^2: question regarding File::Copy, and hashes that contain file paths
in thread question regarding File::Copy, and hashes that contain file paths
Take a look at File::Copy::Recursive
poj#!/usr/bin/perl use strict; use File::Copy::Recursive qw(dircopy dirmove); use Time::Piece; my $MDY = localtime->mdy(''); print "$MDY \n\n"; my $src = 'e:/pervasive/staging/summit/'; my $dest = 'e:/pervasive/test/'; my @f = qw(01 02 03 04 05 06 07 08 30 40 41 42 43 44 44 50 80 85 99 ); my %compHash; for my $n (@f[0]){ # replace with @f if it works for first $compHash{'C'.$n} = 'APEX'.$n.'2015/C'.$n; $compHash{'C'.$n.'-2015'} = 'APEX'.$n.'2015/CSW'; }; foreach my $key (sort keys %compHash) { my $from = $src.$key; my $to = $dest.$compHash{$key}; print "Moving $from $to\n"; dirmove ( $from,$to ) or die "$!"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: question regarding File::Copy, and hashes that contain file paths
by Leetsauce (Novice) on Dec 16, 2015 at 00:23 UTC | |
|
Re^4: question regarding File::Copy, and hashes that contain file paths
by Leetsauce (Novice) on Dec 17, 2015 at 21:13 UTC | |
by poj (Abbot) on Dec 17, 2015 at 21:32 UTC | |
by Leetsauce (Novice) on Dec 18, 2015 at 14:32 UTC | |
by Your Mother (Archbishop) on Dec 18, 2015 at 15:13 UTC |