in reply to Confused scoping while using File::Find

Your sub ProcessFile is defined to form a closure on the lexical @a_files. It will bind to the first instance, and ignore others.

One simple way to fix this is to make @a_files global and localize it instead where the my declaration occurs.

After Compline,
Zaxo

  • Comment on Re: Confused scoping while using File::Find

Replies are listed 'Best First'.
Re^2: Confused scoping while using File::Find
by rongoral (Beadle) on Oct 11, 2004 at 15:39 UTC
    Thanks for looking at my issue. I do not want to make this a global variable. I want to keep any class memebers within the $hr_self object ref.