in reply to Re: passing number of files in directory to subroutine
in thread passing number of files in directory to subroutine

I agree wrt / versus \\ - that's my C/Windows background shining through again :).

Pretty sure the original problem was the missing / however.

I also think you are correct raising the issue of the file orders in the two arrays. Most OS's don't guarantee the order that files are stored in a dir and you can be pretty sure it won't be alphabetical for example. OP may be wise to sort the arrays before he uses them if the pairing order is important.


Perl is Huffman encoded by design.
  • Comment on Re^2: passing number of files in directory to subroutine

Replies are listed 'Best First'.
Re^3: passing number of files in directory to subroutine
by Angharad (Pilgrim) on Sep 23, 2005 at 11:45 UTC
    Hi. Your code worked a treat, thanks Grandfather. As regards to the ordering of the arrays .. advice duly noted. In this case, the files are called something along these lines:
    nameoffile012298.txt
    etc .. so for one file in one directory there is a corresponding file with the exact same name and number in the other directory. Seems to be working without the need for sorting right now but I shall be watchful :)