in reply to Threads Calling Subroutine from different PM File
In addition to the previous answer, you can wrap it into an anonymous subroutine, like this:
my $thr = threads->new( sub { MyModule::Execute($arg1, $arg2) } );
(but do check that your code does not change the values of $arg1 and $arg2 after that. With proper scoping, that is not hard to do.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threads Calling Subroutine from different PM File
by BrowserUk (Patriarch) on Nov 26, 2012 at 17:46 UTC | |
by Anonymous Monk on Nov 26, 2012 at 17:51 UTC | |
by BrowserUk (Patriarch) on Nov 26, 2012 at 18:24 UTC |