http://www.perlmonks.org?node_id=90350


in reply to find or grep?

The find line that you have won't work, unless you enclose the find command in backticks (and are on Unix). See the documentation for the File::Find module to see the proper way of doing a find from Perl. It's a standard module, so you wouldn't have to install anything.

--ZZamboni

Replies are listed 'Best First'.
Re: Re: find or grep?
by nkpgmartin (Sexton) on Jun 21, 2001 at 18:34 UTC
    If I use:
    use File::Find; find(\&wanted, '$file'); sub wanted { $rlfile = `find2perl / -name $file -exec ls {} \;`; }
    I get the error: cant stat blah: no such file or directory. How can I get $rlfile to equal the full path name to blah (which is $file)?