in reply to Re^2: code executed at end of a thread
in thread code executed at end of a thread

.... well then, use the nested labeled loops, as i suggested..... that code is just a simple example to illustrate exacting thread control..... running threads on manual so to speak, rather than requireing a thread helper library like a queue......and goto's are such a clean hack, that everyone should have it in their toolkits, even if the bossman dosn't like them :-)

....you can start up threads and pass perl code strings to them, thru shared variables, and have them eval'd in the thread.....but then the ugliness of an exit call taking down the whole house of cards raises it's head..... i don't know what you are doing, but threads may not be what you are looking for....unless you are on win32..... bwahaha.... then i can't help

....but you may have a bigger design problem with module safety..... hows that for b*llsh*t ;-)


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku

Replies are listed 'Best First'.
Re^4: code executed at end of a thread
by dk (Chaplain) on Dec 05, 2009 at 13:22 UTC
    "unless i'm on 32"... year right :) I'm using threads to emulate a proper popen() on win32 that returns a handle that I can use in select() . Other than this, the advice above with END inside eval actually works for me just fine.

    thanks for a brainstorm!