in reply to Re^6: Renaming an image filein thread Renaming an image file
You mean =~, not =. That fixes the error mentioning $_ (s/// works on $_ by default).
Also, the Perlish way to loop over an interval like that is for my $i (0..3) {.