Are strict and warnings on? My first reaction would be that $passwd may be empty (maybe you declared $password)... other than that, if you're using single quoted declarations... things such as @ or $ in your password shouldn't be an issue. Sorry for stating the obvious.. but I tested this code fine on Win32 to Solaris 8.