|We don't bite newbies here... much|
Neat little trick. I didn't realize you could tie entities to package main, though I don't see why not, and your demonstration shows there's nothing preventing it from being done.
The no warnings qw/syntax/; line seems unnecessary. Is there a reason for it?
I wasn't able to find anything that looked particularly questionable about the code, and running with full warnings it didn't produce any complaints. I'm running Perl version 5.8.2 for Win32. Is there an issue with warnings under other versions? ...just curious.
Also, out of curiosity, what advantage is there to implementing a tied hash in this situation as opposed to a tied scalar?
Update: Trying to answer my own question I did re-implement your solution with simple tied scalars, and found no functional difference, so I assume that the choice to tie a hash was either habbit, or based on something that hasn't occurred to me.
Again, loved the trick.