in reply to Re^2: Tie::File is driving me crazy
in thread Tie::File is driving me crazy

This is the very problem one avoids by not using global vars to pass data to functions.