http://www.perlmonks.org?node_id=820434


in reply to variable scope within eval{}

I think the assembled monks are scratching their heads because there's nothing all that special about an eval{} block. It should be simple enough to test - just compare the results of running your code as is and with the eval { ... }; opening/close lines commented out.

Something else that caught my eye is the way you're calling insert_budget_line_year. The => arrow notation implies you're building a hash from the arguments, but then I'd expect:

@bly_id = insert_budget_line_year ( bl_id => $bl_id, planning_horizon => \@planning_horizon, # array ref...? );
Depends on how you're handling the parameters in the subroutine.

Perhaps if you showed the pertinent parts of insert_budget_line_year, it might shed more light on what's happening.