I guess this must be a stupid question, but I am stumped.
I am using eval{} blocks to implement database transactions (or I would like to). I am putting my important updates inside an eval{} block. The problem seems to be that I can't pass variables between subroutines within an eval block.
Example:
eval {
$bl_id = insert_budget_line ();
@bly_id = insert_budget_line_year (
bl_id => $bl_id,
planning_horizon => @planning_horizon,
);
};
In the above, $bl_id is visible within the eval block, but it is NOT visible inside of subroutine insert_budget_line_year().
What gives?