XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Well I'm not sure this will work because the code makes the program go down the directory first, not across. Based on your idea it would have to keep a record somehow of the $oldir variable for when it finally finished going down the tree and came back to start on the next level. This requires it to keep a kind of memory of the tree and what it has or hasn't done. There must a simpler way.
BUT ... your idea has merit and something I'd considered also - your post has made me rethink it. If the number of path seperators is greater than $depth then don't push to the stack. That may work. I just don't like using relying on counting "\" in strings as a reliable method of keeping track of depth. If by chance a directory has that character in it, the routine will fail. Dean The Funkster of Mirth Programming these days takes more than a lone avenger with a compiler. - sam RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers In reply to Re^2: Depth Listing in Directory Traversal
by crabbdean
|
|