for($i = $self->{'Count'}; $i > 1; $i--) { $j = $i - 1; $next = "${currn}." . $i . $ext; $prev = "${currn}." . $j . $ext; if ( -r $prev && -f $prev ) { move($prev,$next) ## move will attempt rename for us or croak "error: move failed: ($prev,$next)"; } }