for (0..102) { $_ = sprintf "%04d\n", $_; print; } #### my $new = 'snowscene.' . sprintf( '%04d', $loop) . '.jpg';