And a thought for the out-of-box folks: It is possible, under certain environments, that the directory exists but the account running the script might not have sufficient access to see it. It would therefore "not exist" from the runtime perspective.
Not allowed to ask how I know this can be an issue. :-(
Comment on Re^2: File::Spec tmpdir() is behaving wrongly in Windows7