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


in reply to Trouble with File::Find::Rule

It looks like your second time through the loop, the contents of @files, will be overwritten.

Do you even need a loop? Would the following not work as well?

@files = File::Find::Rule->file() ->name( "*.wma", "*.wmv" ) ->in( 'C:\Test\Calls\Archive', 'C:\Test\Calls\History');

Replies are listed 'Best First'.
Re^2: Trouble with File::Find::Rule
by sowais (Sexton) on Dec 12, 2013 at 21:34 UTC

    wazat, that did work and thanks for pointing that out (an embarrassing obvious). A second set of eyes does help!

Re^2: Trouble with File::Find::Rule
by taint (Chaplain) on Dec 12, 2013 at 22:10 UTC
    In addition to wazat's advice. I wonder if File::List might be helpful too.

    --Chris

    Yes. What say about me, is true.
    

      In addition to wazat's advice. I wonder if File::List might be helpful too.

      And hammer and pancakes

        Given all the time saved dumping the @files loop, for File::List. There'll be plenty of time for whatever.
        Yes. What say about me, is true.