I was also puzzled by this till I realized that, for any empty case (either an empty dir or one without subdirs), the "recursive" call isnt going to return (); its going to return whatever its already in @dirs
So, in fact this "recursive" function is using @dirs as an stack. But in any case I dont think this is a good way to solve the problem, cause it really depends on something that is not evident at first sight, and it goes against the intuitive definition of your function; that is, you would expect it to return the subdirs of a dir you pass to it, not that and whatever you already have in @dirs.
In reply to RE: Its not supposed to!
by Anonymous Monk
in thread Its not supposed to!
by BBQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |