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

While experimenting with a threaded script and a data structure with a few hundred crossreferences I get about 70 of these messages when it loads and shares my object between the threads:

Deep recursion on anonymous subroutine at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/threads/shared.pm line 128, <DATA> line 16.

I'm using Thread::Queue and the object is shared and working as expected so I'm trying to squelch these annoying messages.

I have tried to comment out use warnings;, added no warnings 'recursion'; and finally no warnings; but Perl seems to insist on warning me about this?

-- Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re: no warnings 'recursion' does nothing?
by BrowserUk (Patriarch) on Jul 17, 2010 at 21:53 UTC

    Not withstanding your "working as expected", before I would consider silencing this warning, I'd want to be very sure that this data structure that I'm cloning that goes more than 100 levels deep is actually correct.

    Personally, I find it very hard to imagine a use for such a deeply nested construction. Shared or otherwise.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: no warnings 'recursion' does nothing?
by ww (Archbishop) on Jul 17, 2010 at 20:41 UTC

    I'm guessing that you have applied the modifications you mention in your script. But note that the module also uses warnings.

    package Thread::Queue; use strict; use warnings;
      Doh... the thought never even crossed my mind :o)

      -- Time flies when you don't know what you're doing
Re: no warnings 'recursion' does nothing?
by zwon (Abbot) on Jul 17, 2010 at 20:42 UTC

    Did you added no warnings into threads/shared.pm? Because if you add it into your main script it will have no effect onto threads::shared behaviour.