in reply to Attempt to free unreferenced scalar...

Is there any reason that you don't do as perlsyn says and put an error check on your opens?
open (LISTA, "find $folder -type f|") or die "Cannot find '$folder': $!";
That may or may not solve your immediate problem, but it definitely solves A problem...

And another thing, you are likely littering the process table with zombies. This may well be the cause of your loop crashing. You can either set a child handler, or you can start calling wait or waitpid to let your children exit. (If this guess is right then the error check should have noticed and pointed you in the right direction.)

UPDATE
I think I am wrong about the zombie guess. As mentioned below I suspect either memory corruption or a Perl bug. Using backticks to collect output may fix the program, but the bug should still be tracked down and reported.

Replies are listed 'Best First'.
Re: (tilly) 1: Attempt to free unreferenced scalar...
by Daniellek (Sexton) on Nov 29, 2000 at 18:28 UTC
    I don't use 'die', because this is not problem with opening "find"... I tried it some time ago, but script didn't die and "unreferenced..." where still there.

    I don't know if I understand second part of Your answer, but i need this script to be multithreaded...

    Thanks in advance for your patience :)

    -- Daniellek
      Please use die. Please, please, please. Even if it is not the problem this time, it is a really bad idea to leave production code sitting around without error checks left in. The majority of time and energy is spent on maintaining code, and error checks make a massive difference in either narrowing down what the problem is or what it isn't.

      As for the second part...(reads)...oops. I was giving advice based on my experiences with IPC::Open3, apparently on a straight piped open Perl does wait for you. In case you need to know that, when a child process is created and tries to die, it cannot finish dying until it tells its parent what its return status is. A process can wait in this last stage of death forever, and a process in that state is called a zombie. So if you spawn lots of children, then you have to check for them from time to time to avoid zombies.

      Still for your use, consider using `` to run the system commands and collect output. Less code, and the error checks are done for you.

      That may fix the problem, but still glancing in perldiag I see that your warning is supposed to indicate either a bug at the C level (in Perl or in an XS module) or else memory corruption. If you have no C modules you are going to and can reproduce the problem on another box, it is a Perl bug and you should use the perlbug utility to report it. First try to whittle it down to the smallest loop that you can which produces the problem. Then report it.

        Ok, i've started narrowing code to this places where errors are (and adding "die" where it's possible :)

        Talking about the modules, i use mime-tools and mime-base64 i'll try (while narrowing) removing them and check if it solves the problem...

        Thanks for your hints, i really appreciate your help.

        -- Daniellek