in reply to A problem with tie

You are trying to open a non-existant file for reading.
tie will happily create the file for you, but you die before that.
Remove the (seemingly) useless open call, and it should work fine.