I think there are more files than names. (You could check this with print files => scalar(@files), "\n";). If that's the case, you might want @names = ('a'..'zz'); to make sure it's long enough. Or use the fact that perl can auto-increment strings, as in the example perl -le '$n = "a"; print ++$n for 1 .. 100'
Also, don't ignore haukex++'s advice.
edit: and as general debugging advice, when you see "uninitialized", it's a good idea to check if you're getting an undef somewhere; given it's in the $to, I assumed that meant the second argument to move was missing (and my tests show that passing move "source", undef does give those errors). If you need help finding the undef, print values before trying to use them.
In reply to Re: Renaming files in directory
by pryrt
in thread Renaming files in directory
by WisDomSeeKer34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |