in reply to Re: Strange bug with map
in thread Strange bug with map
Most likely, the "sub getObservations{}" modifies $_ , which would upset the values in the "map" case, where he uses "$_->getObservations() ".
In the "for" loop, he uses "$docP->" as the alias for the values, so modifying $_ inside "sub getObservations" will not change the values.
The fix would be to "local $_" inside "sub getObservations{}" where necessary.
"Think of how stupid the average person is, and realize half of them are stupider than that." - George Carlin
|
|---|