Subject: | unmatched expression causes errors |
if the match fails, $1 is still assigned to $sty, which causes errors
like these:
Use of uninitialized value $1 in numeric gt (>) at /pro/lib/perl5/
site_perl/5.10.0/Spreadsheet/XLSX.pm line 155.
Argument "A" isn't numeric in numeric gt (>) at /pro/lib/perl5/
site_perl/5.10.0/Spreadsheet/XLSX.pm line 155.
Argument "D" isn't numeric in numeric gt (>) at /pro/lib/perl5/
site_perl/5.10.0/Spreadsheet/XLSX.pm line 155.
Argument "E" isn't numeric in numeric gt (>) at /pro/lib/perl5/
site_perl/5.10.0/Spreadsheet/XLSX.pm line 155.
I Prose the following patch (also attached):
--8<---
--- XLSX.pm 2009-01-05 19:43:26.000000000 +0100
+++ /pro/lib/perl5/site_perl/5.10.0/Spreadsheet/XLSX.pm 2009-01-08
08:30:57.000000000 +0100
@@ -148,11 +148,9 @@ sub new {
$row = $3 - 1;
- $s = /t=\"s\"/ ? 1 : 0;
- $s2 = /t=\"str\"/ ? 1 : 0;
- /s="([^"]*)"/; #"
-
- $sty = $1>0 ? $1 : 0 ;
+ $s = m/t=\"s\"/ ? 1 : 0;
+ $s2 = m/t=\"str\"/ ? 1 : 0;
+ $sty = m/s="([0-9]+)"/ ? $1 : 0;
}
elsif (/^<v/) {
$flag = 1;
-->8---
Subject: | XLSX.diff |
--- lib/Spreadsheet/XLSX.pm.org 2009-01-05 19:43:26.000000000 +0100
+++ lib/Spreadsheet/XLSX.pm 2009-01-08 08:30:57.000000000 +0100
@@ -148,11 +148,9 @@ sub new {
$row = $3 - 1;
- $s = /t=\"s\"/ ? 1 : 0;
- $s2 = /t=\"str\"/ ? 1 : 0;
- /s="([^"]*)"/; #"
-
- $sty = $1>0 ? $1 : 0 ;
+ $s = m/t=\"s\"/ ? 1 : 0;
+ $s2 = m/t=\"str\"/ ? 1 : 0;
+ $sty = m/s="([0-9]+)"/ ? $1 : 0;
}
elsif (/^<v/) {
$flag = 1;