Have a look at File::Temp:
use File::Temp 'tempfile'; my ($fh, $filename) = tempfile(); [download]
In reply to Re: Alternate command for tmpnam by Corion in thread Alternate command for tmpnam by kishore05