Jose,
        Keep the list in the loop. Sometimes some of us get busy, (or goto
lunch), and you won't get a response quickly.

The code looks okay, so why not post what the error is so that we can tell
you what is wrong.
Also why not post how you are calling the subroutine.



> -----Original Message-----
> From: Torres, Jose [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 10:35 AM
> To: 'Nikola Janceski'
> Subject: RE: iterating over the contents of a directory
> 
> 
> I have some code like this:
> 
> sub CreateChecksum {
>       my($dir) = @_;
>       opendir(DIRHANDLE, $dir) || "ERROR: cannot read $dir\n";
>       foreach (readdir(DIRHANDLE)){
>               print "\nfound $_\n";
>       }
>       closedir DIRHANDLE;
> }
> 
> where the name of a directory is passed into the subroutine. 
> But every time
> I run it, it keeps erroring out and I have no idea why. I'm 
> passing a valid
> directory name into the subroutine. Am I missing something 
> here? Thanks.
> 
> -----Original Message-----
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 10:27 AM
> To: Torres, Jose; '[EMAIL PROTECTED]'
> Subject: RE: iterating over the contents of a directory
> 
> 
> check out opendir readdir and closedir.
> 
> > -----Original Message-----
> > From: Torres, Jose [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 29, 2002 10:23 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: iterating over the contents of a directory
> > 
> > 
> > Hi,
> > 
> > How can I simply iterate over the contents of a directory? I 
> > want to perform
> > a certain
> > action when I locate a particular text file. Thanks.
> > 
> > 
> > 
> > -Jose
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --------------------------------------------------------------
> --------------
> --------------------
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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

Reply via email to