deadpickle has asked for the wisdom of the Perl Monks concerning the following question:
I have a program that uses threads. And within these threads I tried to call a subroutine by simply calling &sendxml. When I do this the program does not call the subroutine and continues through the thread. Why is this? Is this a known issue? The thread is started by: my $recv = threads->new(\&recvxml);
Re: thread wont call subroutine
by almut (Canon) on Jun 02, 2009 at 21:39 UTC
|
Don't think this a known issue, so it would help if you could post a minimal (but complete) sample program that exhibits the problem...
| [reply] |
Re: thread wont call subroutine
by carlin (Beadle) on Jun 02, 2009 at 22:20 UTC
|
I'll take a stab in the dark here; are you sure the thread isn't running the subroutine but the program is exiting before it completes?
Try calling $recv->join; below your thread declaration. | [reply] [d/l] |
|