in reply to return an array from File::Find

Or, you can forget File::Find and use the much superior (IMHO) File::Find::Rule:
use File::Find::Rule; my @files = File::Find::Rule->file->in( "dir", "../another_dir" );

Replies are listed 'Best First'.
Re^2: return an array from File::Find
by CountZero (Bishop) on Mar 30, 2008 at 21:16 UTC
    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