in reply to Re: return an array from File::Find
in thread return an array from File::Find

Your code is (probably) not equivalent to what the OP wanted: his code (if it would have worked) will also return directories, while yours only returns proper files. Of course, the OP is not very clear about it: he speaks about files but his code does not check for just files.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James