Monks, I need your help.
I am trying to open directories in a recursive function... somethings like that :
use strict; my $dir = "/"; my $file; sub openNewDir { $dir = shift; opendir (DIR, $dir); while ($file = readdir (DIR)) { if (-d $file) { openNewDir($dir.$file."\\"); } else { # Do something with the file } } close (DIR); } openNewDir ($dir);
But I quickly realyse that the HandleDir DIR is lost when the function is call for the second time.
So I try to replace DIR by "$dir$file" which is an unic ID. But the use strict give me an error message that I can't do that...
Why ? ... and What can I do instead of ?
Thanks for your help.
BoBiOne KenoBi ;)
In reply to Recursive opendir without by bobione
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |