Cool File & Directory Modules File::Temp 25 of 69 : prev | index | next

File::Temp

Some Examples

  use File::Temp qw/ tempdir /;
  $dir = tempdir( $template, CLEANUP => 1 );
  $dir = tempdir( CLEANUP => 1 );

Create a temporary directory using the supplied template, but attempt to remove it (and all files inside it) when the program exits. The directory removal is made with the rmtree() function from the File::Path module. If the template is not specified, the temporary directory will be created in tmpdir() and will also be removed at program exit.


© 2003 Barbie - barbie@missbarbell.co.uk contents http://birmingham.pm.org/