in reply to variable scope within eval{}
In the above, $bl_id is visible within the eval block, but it is NOT visible inside of subroutine insert_budget_line_year().
You are retrieving the parameters from @_ inside insert_budget_line_year(), aren't you? Sounds like a stupid question, but then I've seen (and perpetrated) too many *facepalm* bugs.
my $bl_id = "foo"; # code, code, code... if(1){ eval{ my $bl_id = "bar"; my $res = insert_budget_line_year ( bl_id => $bl_id, ); } } sub insert_budget_line_year { print $bl_id,"\n"; } __END__ foo
|
|---|