From:                   "John W. Krahn" <[EMAIL PROTECTED]>

> Dhiraj P Nilange wrote:
> > The problem
> > is that as I am unable to declare filehandle
> > (I am using "readdir" and "opendir" builtin
> > functions) ; in subsequent calls to the
> > sub ; the HANDLE refers to the firstmost
> > opened directory.
> > 
> > if I used "my" keyword for this purpose then
> > perl gives error.
> > 
> > So how to define file handle locally? its my
> > urgent need!
> 
> local *DIRHANDLE;
> opendir DIRHANDLE, $dir or die "Cannot open $dir: $!";
> # etc.

Or

        use FileHandle;
        my $DH;
        opendir $DH, $dir or die ...

You might need at least Perl 5.005 or maybe 5.004 for this to work, 
I'm not sure.

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to