Perl script code example to create temporary file-tempfile()
Posted on April 28th, 2008 by linux
Here is a perl script example how to create temporary file on the file system:
TEMPLATE DIR AND SUFIX are option !
#!/usr/bin/perl
my $tempfile = new File::Temp ( TEMPLATE => 'tempfile_XXX', DIR => '/tmp/', SUFIX => '' );
this will create a temporary file in /tmp/ directory with name tempfile_XXX where X is random generated character.
Filed under: Linux, Perl, Programming