If you get this error when running Gearman client code:

Can't call method "syswrite" on an undefined value at /usr/local/share/perl/5.10.1/Gearman/Taskset.pm line 202.

The fix is to specify the port explicitly. Change:

$client->job_servers('127.0.0.1');

To:

$client->job_servers('127.0.0.1:4730');