my $prefix = "$to_dir/$base_name"; my $suffix = ".jpg"; my @names = "$prefix$suffix"; for (my $i = 0; $i < 10; $i++ ) { push @names, "$prefix.$i$suffix"; last unless -e $names[-1]; } while (@names >= 2) { rename_and_log($names[-2], $names[-1]); pop @names; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: rotating files, is there a better way?
by merlyn
in thread rotating files, is there a better way?
by greenFox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |