Karger78 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I am using the File::Find::Rule to build a list of all the files in a directory along with sub directory's. My issue is that when i assign it to an array, the whole UNC path is entered into the array. I would just the array to contain the file names. Anyone know how to accomplish this? Below is the code i am using:
@remoteFilelist = File::Find::Rule->file()->in($remoteCpPath);

Replies are listed 'Best First'.
Re: File Find Rule question (relative)
by toolic (Bishop) on Nov 27, 2009 at 17:45 UTC
    The documentation for File::Find::Rule mentions the relative Matching Rule, which seems to be what you are looking for:
    @remoteFilelist = File::Find::Rule->file()->relative()->in($remoteCpPa +th);
Re: File Find Rule question
by gmargo (Hermit) on Nov 27, 2009 at 16:36 UTC

      As it applies here:

      use File::Basename qw( basename ); use File::Find::Rule qw( ); my @remoteFilelist = map basename($_), File::Find::Rule ->file() ->in($remoteCpPath);