read a list of a directory
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
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
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
"Simone P" <si.pa [at] tiscali.it> wrote in message
news:EzfFd.398483$b5.19369415 [at] 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 (</test/*.txt>) {
..
}