SteveS832001 has asked for the wisdom of the Perl Monks concerning the following question:
# # # moves the ATM files from the c: to c:\atm and renames them with t +he # current date. # # use File::Copy; @files = ("ATMCAF00", "ATMCAF01", "ATMCAF12", "ATMCMF01", "ATMCMF12"); $old = "c:/"; $new = "K:/ATM/"; print "Enter the month and day (ex:0605)\n"; $date = <stdin>; chomp($date); sub moving { print "Moving $_ to the K:/ATM \n"; move("$old$_","$new$_$date"); print "$_ has been moved to the K:/ATM\n"; print "---------------------------------------------\n"; } foreach (@files) { &moving; } print "All the ATM files have been renamed and move to the ATM folder\ +n"; $wait = <stdin>;
print "Enter the month and day (ex:0605)\n"; $date = <stdin>; chomp($date); move(c:/atmcaf00,K:/atm/atmcaf00$date); move(c:/atmcaf00,K:/atm/atmcaf01$date); move(c:/atmcaf00,K:/atm/atmcaf12$date); move(c:/atmcaf00,K:/atm/atmcmf01$date); move(c:/atmcaf00,K:/atm/atmcmf12$date); print "All the ATM files have been renamed and move to the ATM folder\ +n"; $wait = <stdin>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Moving files
by ikegami (Patriarch) on Jul 28, 2005 at 21:35 UTC | |
|
Re: Moving files
by shemp (Deacon) on Jul 28, 2005 at 21:25 UTC | |
by Nkuvu (Priest) on Jul 28, 2005 at 21:38 UTC | |
by SteveS832001 (Sexton) on Jul 28, 2005 at 21:56 UTC | |
by Nkuvu (Priest) on Jul 28, 2005 at 22:19 UTC | |
by SteveS832001 (Sexton) on Jul 28, 2005 at 22:43 UTC | |
by 5mi11er (Deacon) on Jul 29, 2005 at 14:40 UTC | |
|
Re: Moving files
by NetWallah (Canon) on Jul 29, 2005 at 15:52 UTC |