in reply to using local variables

For your information, when a single word is used as the key in a hash, perl allows you to omit the quotes. So $wire2{"a"} and $wire2{a} are equivalent, and "$wire2{a}" does what you want.

And ++ to Corion for strictures and warnings.