in reply to Re: Confused scoping while using File::Find
in thread Confused scoping while using File::Find

THANK YOU!!!! This is the answer. Holy Cow!! =) This has been several days of endless frustration. You are indeed a wise one and I bow to your superior knowledge. Thank You.
  • Comment on Re^2: Confused scoping while using File::Find

Replies are listed 'Best First'.
Re^3: Confused scoping while using File::Find
by pg (Canon) on Oct 11, 2004 at 17:56 UTC

    It is quite usual for a new comer to the Perl world being confused by closure, so don't be too frustrated ;-)

    Closure is something nice to know, so you can recognize it next time. But in general, you should avoid it, as it breaks your lexical scope. You want to code in a clear way, not a confusing way ;-) I guess you learned more than just closure, if you think about it more.

      Indeed, I have learned a lesson. A cool one though. I was not sure what a closure was. It is kind of a difficult concept. However, I now see why my variable maintained its value even after the surrounding function had returned and the scope was lost.

      I am grateful for the knowledge passed along.