SamQi has asked for the wisdom of the Perl Monks concerning the following question:

It's not so much a problem with the recursion, as it's a problem with *NOT* recursing. Here is the code I've written (I'm horribly embarassed by it...but I'm learning). If somebody could *please* take a look at it and get back to me asap, thanks. I'm having a huge headache debugging, and I'm sure it's because I don't know what I'm doing. I'm sure there's a much simpler way to do it. I beg of the monks to enlighten me.

If you could please send an email slavenz@exactis.com with any assistance you might have (as well as post it here...I'm just going to see it sooner in my mailbox).

Thank you muchly,
Sam

Replies are listed 'Best First'.
Re: Recursion problem
by merlyn (Sage) on Sep 20, 2000 at 20:27 UTC
    Your code would benefit greatly (easier to write, easier to debug, easier to verify in code review, easier to maintain) to use File::Find rather than writing your own "yet another directory recurser".

    Even if you're doing this "as an exercise", you should first study the source code of the standard module for the basic concepts.

    -- Randal L. Schwartz, Perl hacker

      I originally *HAD* used File::Find, but it did not recurse (nor did File::Recurse) the files the way I wanted it to. I looked through and couldn't (nor could anybody else) find a way to fool it into changing the order it did things.

      So I'm writing my own recursion that adresses symlinks *first* and then looks at directories.

      Trust me...if I could use File::Find to do what I wanted, I would do it in a heartbeat. I *like* File::Find

      Thanks for the pointer, though :)

        I've addressed some of the problem with absolute paths...but it's still not running the parse function when it should.