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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.