Subject: | Hash/arrayref problems |
Treats a hashref like an arrayref. Loads of warnings on uninitialized values. The attached
diff takes care of these.
Thanks!
Ken
Subject: | SimpleXlsx.pm.diff |
90a91
> $DB::single = 1;
92c93,94
< for my $ind (0 .. $#{$xborders})
---
> # for my $ind (0 .. $#{$xborders})
> for my $ind ( keys %$xborders )
98,99c100,101
< 'Color' => defined $xborders->[$ind]->{'left'}->{'color'}->{'indexed'} ? $xborders->[$ind]->{'left'}->{'color'}->{'indexed'} : '',
< 'Style' => defined $xborders->[$ind]->{'left'}->{'style'} ? $xborders->[$ind]->{'left'}->{'style'} : ''
---
> 'Color' => defined $xborders->{ $ind }->{'left'}->{'color'}->{'indexed'} ? $xborders->{ $ind }->{'left'}->{'color'}->{'indexed'} : '',
> 'Style' => defined $xborders->{ $ind }->{'left'}->{'style'} ? $xborders->{ $ind }->{'left'}->{'style'} : ''
103,104c105,106
< 'Color' => defined $xborders->[$ind]->{'right'}->{'color'}->{'indexed'} ? $xborders->[$ind]->{'right'}->{'color'}->{'indexed'} : '',
< 'Style' => defined $xborders->[$ind]->{'right'}->{'style'} ? $xborders->[$ind]->{'right'}->{'style'} : ''
---
> 'Color' => defined $xborders->{ $ind }->{'right'}->{'color'}->{'indexed'} ? $xborders->{ $ind }->{'right'}->{'color'}->{'indexed'} : '',
> 'Style' => defined $xborders->{ $ind }->{'right'}->{'style'} ? $xborders->{ $ind }->{'right'}->{'style'} : ''
108,109c110,111
< 'Color' => defined $xborders->[$ind]->{'top'}->{'color'}->{'indexed'} ? $xborders->[$ind]->{'top'}->{'color'}->{'indexed'} : '',
< 'Style' => defined $xborders->[$ind]->{'top'}->{'style'} ? $xborders->[$ind]->{'left'}->{'top'} : ''
---
> 'Color' => defined $xborders->{ $ind }->{'top'}->{'color'}->{'indexed'} ? $xborders->{ $ind }->{'top'}->{'color'}->{'indexed'} : '',
> 'Style' => defined $xborders->{ $ind }->{'top'}->{'style'} ? $xborders->{ $ind }->{'left'}->{'top'} : ''
113,114c115,116
< 'Color' => defined $xborders->[$ind]->{'bottom'}->{'color'}->{'indexed'} ? $xborders->[$ind]->{'bottom'}->{'color'}->{'indexed'} : '',
< 'Style' => defined $xborders->[$ind]->{'bottom'}->{'style'} ? $xborders->[$ind]->{'bottom'}->{'style'} : ''
---
> 'Color' => defined $xborders->{ $ind }->{'bottom'}->{'color'}->{'indexed'} ? $xborders->{ $ind }->{'bottom'}->{'color'}->{'indexed'} : '',
> 'Style' => defined $xborders->{ $ind }->{'bottom'}->{'style'} ? $xborders->{ $ind }->{'bottom'}->{'style'} : ''
118,119c120,121
< 'Color' => defined $xborders->[$ind]->{'diagonal'}->{'color'}->{'indexed'} ? $xborders->[$ind]->{'diagonal'}->{'color'}->{'indexed'} : '',
< 'Style' => defined $xborders->[$ind]->{'diagonal'}->{'style'} ? $xborders->[$ind]->{'diagonal'}->{'style'} : ''
---
> 'Color' => defined $xborders->{ $ind }->{'diagonal'}->{'color'}->{'indexed'} ? $xborders->{ $ind }->{'diagonal'}->{'color'}->{'indexed'} : '',
> 'Style' => defined $xborders->{ $ind }->{'diagonal'}->{'style'} ? $xborders->{ $ind }->{'diagonal'}->{'style'} : ''
213a216
> no warnings 'uninitialized';