Do not declare $a and $b as lexical variables (with my). They are package globals (though they're exempt from the usual restrictions on globals when you're using use strict).Unless you understand all the possible scoping implications of using $a and $b this way, I'd suggest you avoid using them at all except in matters of sort.
As it turns out, it doesn't cause a problem in this isolated snippet of code, but I recommend you use the solution offered by jeffa.
--Jim
In reply to Re: funky $_ with map {}
by jlongino
in thread funky $_ with map {}
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |