D
DJB
Hi all,
Perl 5.8.6 (ActiveState)
Spreadsheet::WriteExcel 2.15
Windows XP
I'm trying to resolve some confusion I have over two different objects
(seemingly) sharing the same instance variable data. In this case,
it's the _str_unique instance variable.
To see the problem in action, run the following snippet with a
debugger, and put a watch on $workbook->{_str_unique},
$worksheet->{_str_unique} and $self->{_str_unique}. Step into the
$worksheet->write method, and from there step into the write_string
method.
use strict;
use warnings;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new("test.xls");
my $worksheet = $workbook->add_worksheet();
$worksheet->write(0,0,"Hello");
$workbook->close();
After the write method, you'll notice that the
$worksheet->{_str_unique} instance variable is set to 1. That's
expected. What's NOT expected is that $workbook->{_str_unique} is also
set to 1. How did that happen?
Regards,
Dan
Perl 5.8.6 (ActiveState)
Spreadsheet::WriteExcel 2.15
Windows XP
I'm trying to resolve some confusion I have over two different objects
(seemingly) sharing the same instance variable data. In this case,
it's the _str_unique instance variable.
To see the problem in action, run the following snippet with a
debugger, and put a watch on $workbook->{_str_unique},
$worksheet->{_str_unique} and $self->{_str_unique}. Step into the
$worksheet->write method, and from there step into the write_string
method.
use strict;
use warnings;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new("test.xls");
my $worksheet = $workbook->add_worksheet();
$worksheet->write(0,0,"Hello");
$workbook->close();
After the write method, you'll notice that the
$worksheet->{_str_unique} instance variable is set to 1. That's
expected. What's NOT expected is that $workbook->{_str_unique} is also
set to 1. How did that happen?
Regards,
Dan