in reply to CHMOD permissions for Perl Script

Based on the content of your question, I assume your program is running on a Unix system. Considering that any Unix already has a directory specially for the purpose of writing temporary files to, namely /tmp, why would you want to create a directory of your own?

And if you want to make it platform independent, just use:

my $tmpdir = do { require 'File::Spec'; File::Spec->tmpdir(); };
And there are even module that will let you write to a temporary file - but I can't judge from your question whether that will be appropriate for your needs.