If the goal is to process any files that are older than a given value, even if there is just one file, then the script doesn't work as it should.
| [reply] |
You presume that "as it should" means there isn't a minimum number of files required. I don't see any indication your assumption is true — in fact, it seems to contradict the printed message — but if it is,
if (scalar(@Files) > 1) {
or
if (@Files > 1) {
should be replaced with
if (scalar(@Files) > 0) {
or
if (@Files > 0) {
or
if (@Files) {
| [reply] [d/l] [select] |
The reason that I raised the question in the first place, is that skipping the directory scan just because there is just one file seems like a very strange thing to do. Even if its a conscious decision made by learningperl01 (note the handle), I still believe its appropriate to raise the question, since it looks like a classical off by one error.
The printed error message could just be a sloppy way of writing there are no files to process, but we're hardly getting anything out of discussing it further, since learningperl01 isn't following the thread any longer.
| [reply] |