in reply to blessing a hash ref?

When you bless the new hash into Site::Cfg you give it a reference to the package variable %templates. This is because %templates hasn't yet been declared lexical. To fix it move my %templates... above the sub. use strict would have caught it.

I tried to swear at perl and it compiled!