in reply to Question on fork and close.
Try this instead:
This should help, since readdir() in a scalar context returns just the next entry. If this doesn't help, supplying any error message you are running into would help us to give you a better answer.path = "/var/tmp/decode1"; opendir(DIR, $path); while (defined($file=readdir(DIR))) { next unless ($file =~ /\.dat$/); open(INPUT, "$path/$file") or die "can't open file $file: $!"; # do some stuff close INPUT; } closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Question on fork and close.
by sbank (Initiate) on May 30, 2001 at 00:25 UTC | |
by Anonymous Monk on May 30, 2001 at 00:37 UTC |