This being because globs operate on the symbol table and variables declared with my don't end up in the symbol table.
Declaring variables in perl really does seem quite a mess, between use vars,my,our,local,strict on/off. Doesn't matter 99% of the time but every so often something doesn't work quite the way I expect and it annoys me.