my @cat;
for my $path ( @files ){
print $path "$path 2\n";
- close($path);
+ close($path);
open($path, $path);
<$path>;
push @cat, <$path>;
- close($path);
+ close($path);
}
print "not " if (grep {/foo|bar/} @cat) && ! (grep {/baz|quux/} @cat);
print "ok 2\n" ;
cacheout '<', "foo";
print "not " unless <foo> eq "foo 2\n";
print "ok 4\n";
+ close(foo);
}
{# Test 5: that close is overridden properly
- cacheout local $_ = "Foo::Bar";
+ cacheout local $_ = "Foo_Bar";
print $_ "Hello World\n";
close($_);
open($_, "+>$_");
seek($_, 0, 0);
print "not " unless <$_> eq "$_\n";
print "ok 5\n";
+ close($_);
}
q(
{# Test close override
package Bob;
use FileCache;
- cacheout local $_ = "Foo'Bar";
+ cacheout local $_ = "Foo_Bar";
print $_ "Hello World\n";
close($_);
open($_, "+>$_");
seek($_, 0, 0);
print "not " unless <$_> eq "$_\n";
print "ok 5\n";
+ close($_);
}
);
-unlink @files, "Foo'Bar";
+1 while unlink @files, "Foo_Bar";