Changed (Δ40 bytes):

raw changeset »

lib/Text/Template/Simple/Cache.pm (5 lines added, 4 lines removed)

Up to file-list lib/Text/Template/Simple/Cache.pm:

@@ -42,13 +42,14 @@ sub reset {
42
42
   if ( $parent->[CACHE] && $parent->[CACHE_DIR] ) {
43
43
44
44
      my $cdir = $parent->[CACHE_DIR];
45
      local  *CDIRH;
46
      opendir CDIRH, $cdir or fatal( 'tts.cache.opendir' => $cdir, $! );
45
      require Symbol;
46
      my $CDIRH = Symbol::gensym();
47
      opendir $CDIRH, $cdir or fatal( 'tts.cache.opendir' => $cdir, $! );
47
48
      require File::Spec;
48
49
      my $ext = quotemeta CACHE_EXT;
49
50
      my $file;
50
51
51
      while ( defined( $file = readdir CDIRH ) ) {
52
      while ( defined( $file = readdir $CDIRH ) ) {
52
53
         if ( $file =~ m{ ( .* $ext) \z}xmsi ) {
53
54
            $file = File::Spec->catfile( $parent->[CACHE_DIR], $1 );
54
55
            LOG( UNLINK => $file ) if DEBUG;
@@ -56,7 +57,7 @@ sub reset {
56
57
         }
57
58
      }
58
59
59
      closedir CDIRH;
60
      closedir $CDIRH;
60
61
   }
61
62
   return;
62
63
}