in reply to Re (tilly) 1: Attempt to free unreferenced scalar...
in thread Attempt to free unreferenced scalar...

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

Replies are listed 'Best First'.
Re (tilly) 3: Attempt to free unreferenced scalar...
by tilly (Archbishop) on Nov 29, 2000 at 19:01 UTC
    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