Doh! Forgot to import the tempdir() function for setting PERL_CPANM_HOME.