| Author |
read a list of a directory
|
|
| Simone P 2005-01-12, 8:56 pm |
| hi, is it possibile with perl read the list of all file inside a directory
(examples /test/*.txt) ???
Simone
| |
| Gunnar Hjalmarsson 2005-01-12, 8:56 pm |
| 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
| |
| surfking 2005-01-12, 8:56 pm |
| 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()
| |
| Tintin 2005-01-13, 8:57 am |
|
"Simone P" <si.pa@tiscali.it> 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 (</test/*.txt> ) {
..
}
|
|
|
|