I'm still puzzled why you are using local. Is your perl version so old that you do not have 'my' variables? Most would agree that 'local' is only used these days when altering system variables like $/, $|, and so on (OK, there may be other specialised uses, but these are rare).
The replies here indicate that no one has the courage (me included) to say that 'local' has the desired effect, we just don't use it any more.