try closures for the subs and a hash of arrays...as using user/computer generated values for varnames are generally frowned upon and produce horrible code. hashes of arrays and closures, on the other hand, are easily coded for in functional/top-down/modular way.
the hardest line to type correctly is: stty erase ^H