Michael Pratt asked:
> How can I open several files with this format sn.????.txt where ????
> is 0001 0002 so on and so on?
>
Since noone else suggested it :
opendir DIR, $dir;
while ($file = readdir DIR) {
next if $file !~ /^sn\.\d\d\d\d\.txt$/i;
# I don't know if you want it case sensitive. If yes, drop the i
# option at the end of the previous command
next if -d $file;
# just in case
open IN, "$dir/$file" or die "Can't open $dir/$file : $!\n";
...
close IN;
}
Read on opendir, readdir and closedir.
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]