This is just a quick heads up regarding bugs in the implementation of TIE. While I dont think the known bugs with it would be an issue for you, it is something to keep in mind. Take a look at warning: tied vars may evaluate twice in logical expressions