in reply to O, the horrors of references and complex data structures

Others have already told you the clean way to do this (using anonymous hashes), but when you enter the first function you can first do
local *globHash;
and leave all else the same. This replaces the global typeglob with a new temporary replacement, your sub runs, pushes the ref the array, and then returns, replacing the original global. You then run again and get a new typeglob, etc.

Not the best way, but it works.

  • Comment on Re (tilly) 1: O, the horrors of references and complex data structures
  • Download Code