C
Colin
Hi, I am trying to use the following code to read the contents of a several
subdirectories in a single directory.
opendir(MainDir, "/home/colin/data")
while ($file = readdir(MainDir) {
print "$file\n";
opendir(SubDir, $file)
while($otherfiles = readdir(SubDir) {
print "$otherfiles\n";
}
}
Why can I not use $file to represent the directory I want to open in the
second opendir statement?
Can anyone help?
Thanks
subdirectories in a single directory.
opendir(MainDir, "/home/colin/data")
while ($file = readdir(MainDir) {
print "$file\n";
opendir(SubDir, $file)
while($otherfiles = readdir(SubDir) {
print "$otherfiles\n";
}
}
Why can I not use $file to represent the directory I want to open in the
second opendir statement?
Can anyone help?
Thanks