in reply to To Check Last Upload Date on Amazon S3
Hi babah, welcome to perlmonks!
To improve your chances of getting the answer you expect, you should reduce your code to a Short, Self-Contained, Correct Example.
You can also do some work on the readability, and syntax of your code. First, you should use strict and warnings, they are cumbersome, but they let perl try its best at finding your mistake, and perl is really good at it.
This means that you'll have to declare your variables with my, which has two effects: telling perl what the proper spelling is so that it can catch a typo, and where it can be used (it is limited to the current block). BTW, local is not a local variable, it means that the changes you apply are only temporary.
You should also rename your variables to give them more recognizable names, push (@backupListB, $lineB); push (@backupList, $lineBC); pretty much looks like twice the same thing.
Because your code isn't easy to read, and you didn't provide input data, I can't tell you what the problem is for sure, but awk '{print $1" "$2}' does look suspicious. Maybe I don't know awk enough, but as far as I know, print $1, $2 should print the first two fields separated by a space, which I guess is what your code is trying to do. But actually, there's not much awk can do that perl can't, so you should drop the awk altogether and do all the work in perl, this will add another temporary value (the line before it is processed) to debug, or log when something wrong happens.
|
|---|