in reply to renaming a list of files

You should look at sprintf. With it you can map numbers into numeric strings with leading zeros.

for (0..102) { $_ = sprintf "%04d\n", $_; print; }
You can use that in your loop as, my $new = 'snowscene.' . sprintf( '%04d', $loop) . '.jpg';

After Compline,
Zaxo