in reply to Memory Leaks can it be helped?

For some reason when I run this script I get 2 lines or errors all the time so I call a clear screen to clear the errors. It has somting to do when I call the Win32::Perms and File::DirWalk

I think there might be a relation between these errors and the memory use. I also note that you're using globals for some of the data that doesn't need to persist. If you were to use properly-scoped lexicals, you may see less memory use.

Replies are listed 'Best First'.
Re^2: Memory Leaks can it be helped?
by runrig (Abbot) on Aug 17, 2007 at 20:14 UTC
    I think there might be a relation between these errors and the memory use.
    What makes you think that? It turns out that both modules export a constant named SUCCESS, and that is the source of the warnings. But it has nothing to do with the memory leak. The OP is using the fully qualified name $File::DirWalk::SUCCESS, so there's no need to import anything from that module, and "use File::Dirwalk ();" should squelch the warnings.

    That said, I agree with some of the reviewers of File::DirWalk in that I don't see any advantage of this module over File::Find.

      What makes you think that?

      Years of experience answering questions where people don't post the warnings that, if they had read and understood, would have helped them fix their own problems, combined with the curious mixture of global and lexicals and the possible circular reference involved with passing one object to another.

      Call it a hunch.