It feels like homework, but it's work work.
Anyway, I figured I would open the list of files and read them into an array. And please don't laugh, but I really am new to this language! I'm sure I'm missing some subtleties in what follows:
open FILE_LIST, "list.txt"; while(<FILE_LIST>) { #read each line into the array here -- gotta look up the syntax } close FILE_LIST;
Then, I figured I'd iterate through the array and FTP the files to the working directory, which I don't yet know how to do.
Next, I'd save off the .bak copies, doing something like this:
foreach $filename (@files2change) { my $backup = $filename . '.bak'; rename($filename, $backup) open OLD_FILE, $backup; open NEW_FILE, ">>$filename; while(<OLD_FILE>) { print NEW_FILE s/foo/bar/g; } close OLD_FILE; close NEW_FILE; }
And finally, FTP the updated files back.
In reply to Re^2: FTP and update files from a list
by lev36
in thread FTP and update files from a list
by lev36
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |