unless(/^([\w.-]) \s+ ([\w.-])$/x) {
####
unless(/^([\w.-]+) \s+ ([\w.-]+)$/x) {
####
unless(/^([\w.-]) \s+ ([\w.-])$/x) {
(without this extra space)
####
unless(/^([\w.-]+) \s+ ([\w.-]+)$/x) {
print STDERR "$_ is not a valid line";
next;
}
my ($old, $new) = ($1, $2);
unless( -e $old ) {
print STDERR "$old does not exist!\n";
next;
}
rename $old, $new;
####
system("mv $new /var/save/$subfolder_name");
####
#!/usr/bin/perl -wT
####
#!/usr/bin/perl -wT
use strict;
use warnings;
use File::Copy;
...
unless(move("$new", "/var/save/$subfolder_name")) {
print STDERR "Oops! Couldn't move the file: $!";
}
####
Create backup directory
Open file
for each line in info file
next if blank
get filename and rename from file
push filename and rename onto arrays
end for
if size of arrays is too small (smaller than @ftp_locations)
complain that I don't have enough files
exit;
end if
for each item in file array
rename file
ftp file
move file to backup directory
end for
send message saying everything worked.