in reply to variable scope within eval{}
Try to recreate the problem with the simplest script possible. Does it still do this if you assign $bl_id a quoted string? What if you replace insert_budget_line_year with lc()?