The File::BaseDir module can be used to find directories and files as specified by the XDG Base Directory Specification. It takes care of defaults and uses File::Spec to make the output platform specific. . For this module the XDG basedir specification 0.6 was used.