read a list of a directory

read a list of a directory

am 12.01.2005 21:15:32 von Simone P

hi, is it possibile with perl read the list of all file inside a directory
(examples /test/*.txt) ???

Simone

Re: read a list of a directory

am 12.01.2005 21:31:56 von Gunnar Hjalmarsson

Simone P wrote:
> hi, is it possibile with perl read the list of all file inside a directory
> (examples /test/*.txt) ???

Yes.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Re: read a list of a directory

am 13.01.2005 00:38:27 von surfking

While wandering through cyberspace on Wed, 12 Jan 2005 20:15:32 GMT
Simone P said :
> hi, is it possibile with perl read the list of all file inside a directory
> (examples /test/*.txt) ???
>
> Simone

Yes. There are several methods :

(1) use glob()

(2) use opendir() and readdir()

Re: read a list of a directory

am 13.01.2005 08:55:39 von Tintin

"Simone P" wrote in message
news:EzfFd.398483$b5.19369415@news3.tin.it...
> hi, is it possibile with perl read the list of all file inside a directory
> (examples /test/*.txt) ???

Yes, it is possible.

foreach my $file () {
..
}