in reply to cross-platform way to get home directory
There is File::HomeDir, which provides and discusses the various directories in which stuff is stored.