http://www.perlmonks.org?node_id=587462


in reply to tempdir with template fails

From the perldocs for File::Temp:
Trailing `X' characters are replaced with random letters to generate the filename. At least four `X' characters must be present at the end of the template.
And the relevant code from the module:
# Do it using substr - no reason to use a pattern match since # we know where we are looking and what we are looking for if (substr($template, $start - MINX + 1, MINX) ne 'X' x MINX) { ${$options{ErrStr}} = "The template must contain at least ". MINX . " 'X' characters\n"; return (); }