in reply to Re^4: Parallel Modules ?
in thread Parallel Modules ?
Your problem is this line:
my $thr = threads->create(Better::saveBetter, @ParamList); ##.......................^^^^^^^^^^^^^^^^^^
The indicated part (Better::saveBetter) is invoking that subroutine and then passing the result to threads->create() as the first argument.
Replace that line with:
my $thr = threads->create( \&Better::saveBetter, @ParamList );
And your sample will work.
Or rather it will once you correct the typo:
my ($sbn, $cost, $ur) = @_; #..................^^^ print "url: $url\n"; #..............^^^^
Which would have been caught if you had use strict & use warnings in your module.
And would be far more obvious visually if you formatted your code with spaces in the right places:
my( $sbn, $cost, $ur ) = @_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Parallel Modules ?
by Gary Yang (Acolyte) on Nov 29, 2011 at 23:55 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2011 at 00:21 UTC | |
by Gary Yang (Acolyte) on Dec 01, 2011 at 00:50 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2011 at 01:07 UTC |