bichonfrise74 has asked for the wisdom of the Perl Monks concerning the following question:
When I run the client.pl, it will give an error output on the worker.pl something like#!/usr/bin/perl # worker.pl use strict; use Gearman::Worker; my $worker = Gearman::Worker->new(); $worker->job_servers( '127.0.0.1:4730' ); $worker->register_function( 'split_it', \&my_split_function ); $worker->work() while 1; sub my_split_function { my $string = $_[0]->arg; my @new_string = split( ',', $string ); return \@new_string; } ------- #!/usr/bin/perl # client.pl use strict; use Gearman::Client; my $client = Gearman::Client->new(); $client->job_servers('127.0.0.1:4730'); my $result = $client->do_task( 'split_it', 'abc,def' ); print "Split: @$result\n";
Does this mean that it is expecting the worker.pl to return a scalar reference? Since I'm trying to return an array reference, then it is failing?Not a SCALAR reference at /usr/local/share/perl/5.8.8/Gearman/Worker.pm line 365.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Gearman::Client Return Value
by kennethk (Abbot) on Oct 08, 2009 at 00:04 UTC | |
|
Re: Gearman::Client Return Value
by runrig (Abbot) on Apr 05, 2010 at 21:27 UTC |