Maybe you need to add an explicit Close that does the same thing as DESTROY. That way you could have one at a time open, which might avoid problems. As an example, I changed your test code to this: use Excel;
{
my $s = Excel->new("here.xls");
$s->print("one", "Hello World\nThis\tis\ta\ttest\n");
$s->print("one", join("\t", 1 ..10));
$s->print("one", "bye\n");
$s->print("one", join("\n",3 .. 5) . scalar(localtime));
$s->print("two", join("\n",13 .. 25) . scalar(localtime));
$s->print("eight", join("\n",13 .. 20) . scalar(localtime));
}
{
my $t = Excel->new("c:/temp/there.xls");
$t->print("two", join("\n",13 .. 25) . scalar(localtime));
}
and it worked perfectly. (Notice the braces around the two sections.) Putting the sections in blocks like that forces DESTROY to be called before the next new is called.
Guildenstern Negaterd character class uber alles! |