Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Recursively walk a hash to get to an elementby ihb (Deacon) |
on Mar 31, 2005 at 03:27 UTC ( [id://443669]=note: print w/replies, xml ) | Need Help?? |
The reason of the error is that reduce uses a prototype not yet seen when the return statement is compiled. It's therefore interpreted as indirect object syntax (method { STATEMENTS } LIST), being do { STATEMENTS }->method(LIST) with direct syntax. The way to fix this is to call &reduce like List::Util::reduce(sub { ... }, LIST). ihb
See perltoc if you don't know which perldoc to read!
In Section
Cool Uses for Perl
|
|