This isn't 'production' code. I'm playing with this to get ready to use the commands in a project. That's why I'm doing the same thing in two different ways.

I have two ways of of getting a list of file names below, working with opendir and readdir. The second method doesn't work if the first method is active. Commenting out the first segment gets the second segment to work. Reversing the order also of the methods also sees the first one only working.

What I would guess is that I can only use the 'readdir' once in a script. What's that about?

Thanks.

opendir(DIR, $dirname) or die "can't opendir $dirname: $!";

my @filelist = readdir(DIR);
print "[EMAIL PROTECTED]: @filelist\n";

while (my $file = readdir(DIR)) {
    print "$file\n";
}

closedir(DIR);

--
Peter Fleck
Webmaster | University of Minnesota Cancer Center
Dinnaken Office Bldg.
925 Delaware St. SE
Minneapolis, MN  55414
612-625-8668 | [EMAIL PROTECTED] | www.cancer.umn.edu
Campus Mail: MMC 806

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to