I've tried forks and it works but it doesnt exit the sub the same way as threads do.


The bot is built on Net::IRC

Averything is handle with public commands wiht on_public.

For example a stock exchange checker.

i do  .stock ericsson from irc.
Then the bot jumps to a sub and does a alot of prosessing for me and print output to irc. after that is done i just want the sub to die. But this sub just keep goin as another prossess, or they still stay in system like zombies if i kill them. (ps -x)
i've tried exit(0); return; and also join but nothing gets it goin as it does with threads.

I probably don't have enuff knowledge to see what the problem is either :(

All i want is a sub thats runs parallell to other subs and when the sub is done it should just dissapear. Been trying to fix this for 1 month now but no luck :/

The entire script are made around threads It's 14 371 rows of code in 19 files so rewriting it from scratch would suck hehe

Someone said that POE::WHEEL could handle it to but i'm not sure. i just want a easy replacement for threads, forks would be real nice if i just could exit the subs the same way as threads does.

Thank you for your time. Really appreciate it.

In reply to Re: Re: Threads Problem! by Phantazm
in thread Threads Problem! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.