Re: Callbacks

2010-09-09 Thread Jatin Davey
Yes, if no_chdir is not set, then $_ is the current file's name with no path $File::Find::name is the current file's name with the path $File::Find::dir is the path to the current file You may want to read the [perldoc File::Find][0]. [0]: http://perldoc.perl.org/File/Find.html#The-wanted-f

Re: Callbacks

2010-09-09 Thread Chas. Owens
On Thu, Sep 9, 2010 at 12:35, Jatin wrote: > >> File::Find's interface is through its package variables. > > [Jatin] So my subroutine that i use with the File::Find's find method has > access to the package variables ? Correct me if i am wrong. >> >>   It is a very >> bad design and is much regret

Re: Callbacks

2010-09-09 Thread Chas. Owens
On Thu, Sep 9, 2010 at 12:49, Jatin wrote: > >> The callback is printing the value of $File::Find::name (which, again, >> is set by the File::Find::find function before the callback is >> called). >> >> >> > > [Jatin] Chas , when you say that the File::Find's find method sets its name > variable b

Re: Callbacks

2010-09-09 Thread Jim Gibson
On 9/9/10 Thu Sep 9, 2010 9:49 AM, "Jatin" scribbled: > >> The callback is printing the value of $File::Find::name (which, again, >> is set by the File::Find::find function before the callback is >> called). >> >> >> > [Jatin] Chas , when you say that the File::Find's find method sets it

Re: Callbacks

2010-09-09 Thread Jim Gibson
On 9/9/10 Thu Sep 9, 2010 9:35 AM, "Jatin" scribbled: > >> File::Find's interface is through its package variables. > [Jatin] So my subroutine that i use with the File::Find's find method > has access to the package variables ? Correct me if i am wrong. >>It is a very >> bad design and is

Re: Callbacks

2010-09-09 Thread Jatin
The callback is printing the value of $File::Find::name (which, again, is set by the File::Find::find function before the callback is called). [Jatin] Chas , when you say that the File::Find's find method sets its name variable before the callback is called , Do you mean that this "name"

Re: Callbacks

2010-09-09 Thread Jatin
On Thursday 09 September 2010 08:38 PM, Shawn H Corey wrote: On 10-09-09 10:59 AM, Chas. Owens wrote: $File::Find::name is a package variable from File::Find. $File::Find::name is a fully-qualified variable, just in case you're wondering what "fully qualified" means. [Jatin] No , i act

Re: Callbacks

2010-09-09 Thread Jatin
File::Find's interface is through its package variables. [Jatin] So my subroutine that i use with the File::Find's find method has access to the package variables ? Correct me if i am wrong. It is a very bad design and is much regretted, but there is nothing to do about it now. [Jatin]

Re: Callbacks

2010-09-09 Thread Shawn H Corey
On 10-09-09 10:59 AM, Chas. Owens wrote: $File::Find::name is a package variable from File::Find. $File::Find::name is a fully-qualified variable, just in case you're wondering what "fully qualified" means. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about

Re: Callbacks

2010-09-09 Thread Chas. Owens
On Thu, Sep 9, 2010 at 10:25, Jatin wrote: > >> Hi Jatin, >> >> A callback is a reference to a subroutine. > > [Jatin] if a callback is a reference to a subroutine then it can be stored > in scalar variable to call that subroutine. Am i correct in my understanding > ? Yes, all types of references

Re: Callbacks

2010-09-09 Thread Jatin
Hi Jatin, A callback is a reference to a subroutine. [Jatin] if a callback is a reference to a subroutine then it can be stored in scalar variable to call that subroutine. Am i correct in my understanding ? This reference when passed around, allows other code to invoke it. File::Find's fi

Re: Callbacks

2010-09-09 Thread Alan Haggai Alavi
> Hi > > I am a newbie to Perl , I was reading through one of the beginner level > books on perl. I did not understand the concept of "Callbacks" and i > have the following questions on it: > > 1. What are they ? > > 2. Why do we need them ? > > 3. What useful purpose do they achieve ? > > I

Re: Callbacks

2010-09-09 Thread Chas. Owens
On Thu, Sep 9, 2010 at 07:20, Jatin Davey wrote: >  Hi > > I am a newbie to Perl , I was reading through one of the beginner level > books on perl. I did not understand the concept of "Callbacks" and i have > the following questions on it: > > 1. What are they ? > > 2. Why do we need them ? > > 3.