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

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 :)