Use File::HomeDir to find out user's home directory instead of (because of wrong usage) of Cwd