Subject: | Returning array from MCE:Map inside an eval statement fails |
Date: | Mon, 29 Jun 2015 17:43:03 +0000 |
To: | bug-MCE [...] rt.cpan.org |
From: | "Benjamin C. McKeown" <mckeowbc [...] gmail.com> |
In MCE 1.608 when using the MCE::Map::mce_map function within an eval
statement the code will print a warning about an undefined variable and
return a zero element array rather than the correct result.
The following code on Pastebin shows the error: http://pastebin.com/fQHiz0SB
This will print out the following error message:
Use of uninitialized value $_total_chunks in range (or flop) at
lib/MCE/Map.pm line 400
This appears to be happening because the finish function is being called
which undefines $_total_chunks variable before it is used in the return.
Thanks for the help!
Cheers,
Ben McKeown