$path = "bar";
cacheout ($path); # each time you use a filehandle
print $path "output";
And it falls over with the wonderful error message:
Can't use string ("bar") as a symbol ref while "strict refs" in use at
filecache line 22.
So I spend ages trying to work out why the code isn't replacing $path with a ref to a filehandle like it should and it's leaving a bare string in there. I post to London.pm. I ask on IRC. I'm stumped...and then I look at the source. Of course! So FileCache doesn't create reference as store them in $path. It opens a filehandle in the calling package with the same name as the $path. This means that $path in the print statement is treated as a symbolic reference for a variable name and finds the right filehandle.
Okay, this is quite neat, but really really dangerous. use strict quite rightly barfs all over the place when I do this and I have to turn it off.
So it looks like I'm going to have to write my own module. Anyone got any better suggestions? Alternative modules on CPAN to do this?