Hi!

On Tue, Apr 05, 2011 at 07:15:32AM +0300, Shlomi Fish wrote:

> > My inclination is to use FIle::Temp to create a temporary directory to hold
> > all the files and subdirectories I need and then clean this out when I'm
> > done. I just didn't know if there was a different or better common practice
> > in use by other module authors.
> > 
> 
> File::Temp sounds like a good idea for that.

++

I usually controll the CLEANUP parameter via some ENV setting:

  my $cleanup = $ENV{NO_CLEANUP} ? 0 : 1;
  my $dir = tempdir(CLEANUP => $cleanup);

If the test fails I can run it again:
  NO_CLEANUP=1 prove -vl t/test_using_temp_dir.t
and take a look at the temp files created.


-- 
#!/usr/bin/perl                              http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Reply via email to