IIS + Cache + W2003 + HTML header problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have some bizarre behaviour in a CGI script running on
IIS 6.0 under Windows Server 2003.
(Everything was working OK for two years under Windows 2000.)

I am producing reports in XML format.
I am using Cache::Cache to save the XML output for each report.

Everything works fine
when a cached report expires I get an error in my perl program.

I have stuck in many debugging messages and found that:
a) - the cache stuff seems to be working OK.
b) - the error occurs when printing the HTML headers

Specifically - in the following lines of code
Files v7a,v7b,v7c,v7d.xml are all produced - and v8a.xml is NOT.
However if (earlier in the program) I comment out the line that saves the
output to the cache
then everything else works (i.e. file v8a.xml IS produced and I get my
output in the browser).

Anyone got ANY idea what could be causing this?

===========  Code Follows  ===================
# $FDBG = 1
$values->save("v7a.xml") if $FDBG;
printf "Set-Cookie: %s\n",$USER->dlnewcookie;
$values->save("v7b.xml") if $FDBG;
#printf "Set-Cookie: %s\n",$USER->password_cookie;
#$VAL->save("v7c.xml") if $FDBG;

eval { print "Content-type: text/xml;\n"; } ;
if ($@)    {
    printf $FDBG "EVAL Error:\n%s\n",$@ if $FDBG;

$values->save("v7d.xml") if $FDBG;
printf "\n";
### The next line is not executed if saving to Cache.
$values->save("v8a.xml") if $FDBG

Site Timeline