in reply to Problem with Remote User Env Variable Keeps Changing Value...
It would also be a good idea to always use strict and warnings. That will help you identify many problems