r29998 - in /trunk/libspreadsheet-read-perl: ./ debian/ examples/ files/ t/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sat Jan 24 02:05:17 UTC 2009


Author: gregoa
Date: Sat Jan 24 02:05:04 2009
New Revision: 29998

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29998
Log:
New upstream release.

Added:
    trunk/libspreadsheet-read-perl/examples/ss-dups-tk.pl
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/examples/ss-dups-tk.pl
    trunk/libspreadsheet-read-perl/files/Dates.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/Dates.xlsx
    trunk/libspreadsheet-read-perl/files/attr.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/attr.xlsx
    trunk/libspreadsheet-read-perl/files/empty.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/empty.xlsx
    trunk/libspreadsheet-read-perl/files/misc.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/misc.xlsx
    trunk/libspreadsheet-read-perl/files/perc.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/perc.xlsx
    trunk/libspreadsheet-read-perl/files/test.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/test.xlsx
    trunk/libspreadsheet-read-perl/files/values.xlsx
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/files/values.xlsx
    trunk/libspreadsheet-read-perl/t/60_xls.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/60_xls.t
    trunk/libspreadsheet-read-perl/t/61_clr.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/61_clr.t
    trunk/libspreadsheet-read-perl/t/62_fmt.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/62_fmt.t
    trunk/libspreadsheet-read-perl/t/63_misc.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/63_misc.t
    trunk/libspreadsheet-read-perl/t/64_dates.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/64_dates.t
    trunk/libspreadsheet-read-perl/t/65_perc.t
      - copied unchanged from r29997, branches/upstream/libspreadsheet-read-perl/current/t/65_perc.t
Modified:
    trunk/libspreadsheet-read-perl/Changes
    trunk/libspreadsheet-read-perl/MANIFEST
    trunk/libspreadsheet-read-perl/META.yml
    trunk/libspreadsheet-read-perl/Read.pm
    trunk/libspreadsheet-read-perl/debian/changelog
    trunk/libspreadsheet-read-perl/files/perc.xls
    trunk/libspreadsheet-read-perl/t/20_csv.t
    trunk/libspreadsheet-read-perl/t/30_xls.t
    trunk/libspreadsheet-read-perl/t/35_perc.t
    trunk/libspreadsheet-read-perl/t/40_sxc.t
    trunk/libspreadsheet-read-perl/t/45_ods.t
    trunk/libspreadsheet-read-perl/t/50_sc.t

Modified: trunk/libspreadsheet-read-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/Changes?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/Changes (original)
+++ trunk/libspreadsheet-read-perl/Changes Sat Jan 24 02:05:04 2009
@@ -1,4 +1,15 @@
 Revision history for Spreadsheet::Read
+
+0.33	Fri 23 Jan 2009
+
+    - A few Perl::Critic inspired changes
+    - Modified tests to prevent rounding errors (we were not checking for that)
+    - Added examples/ss-dups-tk.pl
+
+0.32	Tue 06 Jan 2009
+
+    - Add basic support for M$ Excel 2007 using Spreadsheet::XLSX
+    - Test suite reports the parsers it found
 
 0.31	Sun 04 Jan 2009
 

Modified: trunk/libspreadsheet-read-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/MANIFEST?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/MANIFEST (original)
+++ trunk/libspreadsheet-read-perl/MANIFEST Sat Jan 24 02:05:04 2009
@@ -1,20 +1,26 @@
 Changes
 examples/ss2tk
+examples/ss-dups-tk.pl
 examples/xlscat
 examples/xls2csv
 files/attr.ods
 files/attr.xls
+files/attr.xlsx
 files/content.xml
 files/Dates.xls
+files/Dates.xlsx
 files/empty.csv
 files/empty.ods
 files/empty.sc
 files/empty.sxc
 files/empty.xls
+files/empty.xlsx
 files/macosx.csv
 files/macosx.xls
 files/misc.xls
+files/misc.xlsx
 files/perc.xls
+files/perc.xlsx
 files/test.csv
 files/test_m.csv
 files/test.ods
@@ -23,7 +29,9 @@
 files/test_t.csv
 files/test_x.csv
 files/test.xls
+files/test.xlsx
 files/values.xls
+files/values.xlsx
 Makefile.PL
 MANIFEST
 README
@@ -45,4 +53,10 @@
 t/45_ods.t
 t/46_clr.t
 t/50_sc.t
+t/60_xls.t
+t/61_clr.t
+t/62_fmt.t
+t/63_misc.t
+t/64_dates.t
+t/65_perc.t
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libspreadsheet-read-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/META.yml?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/META.yml (original)
+++ trunk/libspreadsheet-read-perl/META.yml Sat Jan 24 02:05:04 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.1
 name:                   Read
-version:                0.31
+version:                0.33
 abstract:               Meta-Wrapper for reading spreadsheet data
 license:                perl
 author:                 
@@ -10,47 +10,53 @@
 provides:
   Spreadsheet::Read:
     file:               Read.pm
-    version:            0.31
+    version:            0.33
 requires:                       
   perl:                 5.006
   Exporter:             0
   Carp:                 0
   Data::Dumper:         0
 recommends:
+  perl:                 5.008005
   File::Temp:           0.14
   IO::Scalar:           0
 build_requires:
   perl:                 5.006
   Test::Harness:        0
   Test::More:           0
+resources:
+  license:              http://dev.perl.org/licenses/
+meta-spec:
+  version:              1.4
+  url:                  http://module-build.sourceforge.net/META-spec-v1.4.html
 optional_features:
 - opt_csv:
     description:        Provides parsing of CSV streams
     requires:
-      Text::CSV_XS:     0.23
+      Text::CSV_XS:                        0.23
     recommends:
-      Text::CSV:        1
-      Text::CSV_PP:     1.05
-      Text::CSV_XS:     0.57
+      Text::CSV:                           1.10
+      Text::CSV_PP:                        1.10
+      Text::CSV_XS:                        0.59
 - opt_excel:
     description:        Provides parsing of Microsoft Excel files
     requires:
-      Spreadsheet::ParseExcel: 0.26
+      Spreadsheet::ParseExcel:             0.26
       Spreadsheet::ParseExcel::FmtDefault: 0
     recommends:
-      Spreadsheet::ParseExcel: 0.41
+      Spreadsheet::ParseExcel:             0.48
+- opt_excelx:
+    description:        Provides parsing of Microsoft Excel 2007 files
+    requires:
+      Spreadsheet::XLSX:                   0.08
+      Spreadsheet::XLSX::Fmt2007:          0
 - opt_oo:
     description:        Provides parsing of OpenOffice spreadsheets
     requires:
-      Spreadsheet::ReadSXC:    0.2
+      Spreadsheet::ReadSXC:                0.2
 - opt_tools:
     description:        Spreadsheet tools
     recommends:
-      Tk:                           0
-      Tk::NoteBook:                 0
-      Tk::TableMatrix::Spreadsheet: 0
-resources:
-  license:      http://dev.perl.org/licenses/
-meta-spec:
-  version:      1.4
-  url:          http://module-build.sourceforge.net/META-spec-v1.4.html
+      Tk:                                  0
+      Tk::NoteBook:                        0
+      Tk::TableMatrix::Spreadsheet:        0

Modified: trunk/libspreadsheet-read-perl/Read.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/Read.pm?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/Read.pm (original)
+++ trunk/libspreadsheet-read-perl/Read.pm Sat Jan 24 02:05:04 2009
@@ -6,13 +6,14 @@
 
  Spreadsheet::Read - Read the data from a spreadsheet
 
-=head1 SYNOPSYS
+=head1 SYNOPSIS
 
  use Spreadsheet::Read;
  my $ref = ReadData ("test.csv", sep => ";");
  my $ref = ReadData ("test.sxc");
  my $ref = ReadData ("test.ods");
  my $ref = ReadData ("test.xls");
+ my $ref = ReadData ("test.xlsx");
 
  my $a3 = $ref->[1]{A3}, "\n"; # content of field A3 of sheet 1
 
@@ -21,7 +22,7 @@
 use strict;
 use warnings;
 
-our $VERSION = "0.31";
+our $VERSION = "0.33";
 sub  Version { $VERSION }
 
 use Carp;
@@ -40,6 +41,7 @@
     [ ods	=> "Spreadsheet::ReadSXC"	],
     [ sxc	=> "Spreadsheet::ReadSXC"	],
     [ xls	=> "Spreadsheet::ParseExcel"	],
+    [ xlsx	=> "Spreadsheet::XLSX"		],
     [ prl	=> "Spreadsheet::Perl"		],
 
     # Helper modules
@@ -51,7 +53,7 @@
     $can{$flag} and next;
     eval "require $mod; \@_ or \$can{\$flag} = '$mod'";
     }
-$can{sc} = 1;	# SquirelCalc is built-in
+$can{sc} = __PACKAGE__;	# SquirelCalc is built-in
 
 my $debug = 0;
 my @def_attr = (
@@ -76,7 +78,7 @@
 # Helper functions
 
 # Spreadsheet::Read::parses ("csv") or die "Cannot parse CSV"
-sub parses ($)
+sub parses
 {
     my $type = shift		or  return 0;
     $type = lc $type;
@@ -108,7 +110,7 @@
     } # cr2cell
 
 # cell2cr ("D18") => (4, 18)
-sub cell2cr ($)
+sub cell2cr
 {
     my ($cc, $r) = ((uc $_[0]) =~ m/^([A-Z]+)([0-9]+)$/) or return (0, 0);
     my $c = 0;
@@ -120,7 +122,7 @@
 
 # Convert {cell}'s [column][row] to a [row][column] list
 # my @rows = rows ($ss->[1]);
-sub rows ($)
+sub rows
 {
     my $sheet = shift or return;
     ref    $sheet eq "HASH" && exists $sheet->{cell}   or return;
@@ -147,7 +149,7 @@
 	while ($ss->{maxcol} and not (
 		grep { defined && m/\S/ } @{$ss->{cell}[$ss->{maxcol}]})
 		) {
-	    (my $col = cr2cell ($ss->{maxcol}, 1)) =~ s/1$//; 
+	    (my $col = cr2cell ($ss->{maxcol}, 1)) =~ s/1$//;
 	    my $recol = qr{^$col(?=[0-9]+)$};
 	    delete $ss->{$_} for grep m/$recol/, keys %{$ss};
 	    $ss->{maxcol}--;
@@ -171,6 +173,7 @@
 
 sub _xls_color {
     my ($clr, @clr) = @_;
+    defined $clr               or  return undef;
     @clr == 0 && $clr == 32767 and return undef; # Default fg color
     @clr == 2 && $clr ==     0 and return undef; # No fill bg color
     @clr == 2 && $clr ==     1 and ($clr, @clr) = ($clr[0]);
@@ -178,7 +181,7 @@
     "#" . lc Spreadsheet::ParseExcel->ColorIdxToRGB ($clr);
     } # _xls_color
 
-sub ReadData ($;@)
+sub ReadData
 {
     my $txt = shift	or  return;
     ref $txt		and return; # TODO: support IO stream (ref $txt eq "IO")
@@ -230,7 +233,7 @@
 	if (eof ($in)) {
 	    # This file is either just one single line, or uses \r as eol
 	    close $in;
-	    open $in, "<", $txt or return;
+	    open  $in, "<", $txt or return;
 	    $/ = "\r";
 	    $_ = <$in>;
 	    }
@@ -302,23 +305,30 @@
 	    $txt = "$tmpfile";
 	    }
 	}
-    if ($xls_from_txt or $txt =~ m/\.xls$/i && -f $txt) {
-	$can{xls} or croak "Spreadsheet::ParseExcel not installed";
+    if ($xls_from_txt or $txt =~ m/\.(xlsx?)$/i && -f $txt) {
+	my $parse_type = $txt =~ m/\.xlsx$/i ? "XLSX" : "XLS";
+	$can{lc $parse_type} or croak "Parser for $parse_type is not installed";
 	my $oBook;
 	if ($xls_from_txt) {
-	    $debug and print STDERR "Opening XLS \$txt\n";
-	    $oBook = Spreadsheet::ParseExcel::Workbook->Parse (\$txt);
+	    $debug and print STDERR "Opening $parse_type \$txt\n";
+	    $oBook = $parse_type eq "XLSX"
+		? Spreadsheet::XLSX::Workbook->Parse (\$txt)
+		: Spreadsheet::ParseExcel::Workbook->Parse (\$txt);
 	    }
 	else {
 	    $debug and print STDERR "Opening XLS $txt\n";
-	    $oBook = Spreadsheet::ParseExcel::Workbook->Parse ($txt);
+	    $oBook = $parse_type eq "XLSX"
+		? Spreadsheet::XLSX->new ($txt)
+		: Spreadsheet::ParseExcel::Workbook->Parse ($txt);
 	    }
 	$oBook or return;
 	$debug > 8 and print STDERR Data::Dumper->Dump ([$oBook],["oBook"]);
 	my @data = ( {
-	    type	=> "xls",
-	    parser	=> "Spreadsheet::ParseExcel",
-	    version	=> $Spreadsheet::ParseExcel::VERSION,
+	    type	=> lc $parse_type,
+	    parser	=> $can{lc $parse_type},
+	    version	=> $parse_type eq "XLSX"
+			 ? $Spreadsheet::XLSX::VERSION
+			 : $Spreadsheet::ParseExcel::VERSION,
 	    sheets	=> $oBook->{SheetCount} || 0,
 	    sheet	=> {},
 	    } );
@@ -330,7 +340,9 @@
 	    0x16	=> "yyyy-mm-dd hh:mm",	# m-d-yy h:mm
 	    );
 	$oBook->{FormatStr}{$_} = $def_fmt{$_} for keys %def_fmt;
-	my $oFmt = Spreadsheet::ParseExcel::FmtDefault->new;
+	my $oFmt = $parse_type eq "XLSX"
+	    ? Spreadsheet::XLSX::Fmt2007->new
+	    : Spreadsheet::ParseExcel::FmtDefault->new;
 
 	$debug and print STDERR "\t$data[0]{sheets} sheets\n";
 	foreach my $oWkS (@{$oBook->{Worksheet}}) {
@@ -348,16 +360,36 @@
 	    my $sheet_idx = 1 + @data;
 	    $debug and print STDERR "\tSheet $sheet_idx '$sheet{label}' $sheet{maxrow} x $sheet{maxcol}\n";
 	    if (exists $oWkS->{MinRow}) {
-		foreach my $r ($oWkS->{MinRow} .. $sheet{maxrow}) { 
-		    foreach my $c ($oWkS->{MinCol} .. $sheet{maxcol}) { 
+		foreach my $r ($oWkS->{MinRow} .. $sheet{maxrow}) {
+		    foreach my $c ($oWkS->{MinCol} .. $sheet{maxcol}) {
 			my $oWkC = $oWkS->{Cells}[$r][$c] or next;
 			defined (my $val = $oWkC->{Val})  or next;
 			my $cell = cr2cell ($c + 1, $r + 1);
 			$opt{rc}    and $sheet{cell}[$c + 1][$r + 1] = $val;	# Original
+
+			my $fmt;
 			my $FmT = $oWkC->{Format};
-			my $fmt = $FmT->{FmtIdx}
-			   ? $oBook->{FormatStr}{$FmT->{FmtIdx}}
-			   : undef;
+			if ($FmT) {
+			    unless (ref $FmT) {
+				$fmt = $FmT;
+				$FmT = {};
+				}
+			    }
+			else {
+			    $FmT = {};
+			    }
+			foreach my $attr (qw( AlignH AlignV FmtIdx Hidden Lock
+					      Wrap )) {
+			    exists $FmT->{$attr} or $FmT->{$attr} = 0;
+			    }
+			exists $FmT->{Fill} or $FmT->{Fill} = [ 0 ];
+			exists $FmT->{Font} or $FmT->{Font} = undef;
+
+			unless (defined $fmt) {
+			    $fmt = $FmT->{FmtIdx}
+			       ? $oBook->{FormatStr}{$FmT->{FmtIdx}}
+			       : undef;
+			    }
 			if ($oWkC->{Type} eq "Numeric") {
 			    # Fixed in 0.33 and up
 			    # see Spreadsheet/ParseExcel/FmtDefault.pm
@@ -375,15 +407,15 @@
 			    }
 			defined $fmt and $fmt =~ s/\\//g;
 			$opt{cells} and	# Formatted value
-			    $sheet{$cell} = exists $def_fmt{$FmT->{FmtIdx}}
+			    $sheet{$cell} = $FmT && exists $def_fmt{$FmT->{FmtIdx}}
 				? $oFmt->ValFmt ($oWkC, $oBook)
 				: $oWkC->Value;
 			if ($opt{attr}) {
 			    my $FnT = $FmT->{Font};
-			    my $fmt = $FmT->{FmtIdx}
+			    my $fmi = $FmT->{FmtIdx}
 			       ? $oBook->{FormatStr}{$FmT->{FmtIdx}}
 			       : undef;
-			    $fmt and $fmt =~ s/\\//g;
+			    $fmi and $fmi =~ s/\\//g;
 			    $sheet{attr}[$c + 1][$r + 1] = {
 				@def_attr,
 
@@ -392,7 +424,7 @@
 				merged  => $oWkC->{Merged} || 0,
 				hidden  => $FmT->{Hidden},
 				locked  => $FmT->{Lock},
-				format  => $fmt,
+				format  => $fmi,
 				halign  => [ undef, qw( left center right
 					   fill justify ), undef,
 					   "equal_space" ]->[$FmT->{AlignH}],
@@ -431,6 +463,7 @@
 	    local $/;
 	    open my $sc, "<", $txt or return;
 	    $txt = <$sc>;
+	    close   $sc;
 	    $txt =~ m/\S/ or return;
 	    }
 	my @data = (
@@ -490,6 +523,7 @@
 	    open my $f, "<", $txt	or  return;
 	    local $/;
 	    $txt = <$f>;
+	    close $f;
 	    }
 	!$sxc && $txt =~ m/^<\?xml/i and
 	    $sxc = Spreadsheet::ReadSXC::read_xml_string ($txt, $sxc_options);
@@ -557,7 +591,8 @@
 
 For OpenOffice this module uses Spreadsheet::ReadSXC
 
-For Excel this module uses Spreadsheet::ParseExcel
+For Microsoft Excel this module uses Spreadsheet::ParseExcel or
+Spreadsheet::XLSX
 
 For CSV this module uses Text::CSV_XS (0.29 or up prefered) or
 Text::CSV_PP (1.05 or up required).
@@ -851,6 +886,10 @@
 
 http://search.cpan.org/dist/Spreadsheet-ParseExcel
 
+=item Spreadsheet::XLSX
+
+http://search.cpan.org/dist/Spreadsheet-XLSX
+
 =item Spreadsheet::ReadSXC
 
 http://search.cpan.org/dist/Spreadsheet-ReadSXC
@@ -889,6 +928,6 @@
 Copyright (C) 2005-2009 H.Merijn Brand
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself. 
+it under the same terms as Perl itself.
 
 =cut

Modified: trunk/libspreadsheet-read-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/debian/changelog?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/debian/changelog (original)
+++ trunk/libspreadsheet-read-perl/debian/changelog Sat Jan 24 02:05:04 2009
@@ -1,3 +1,9 @@
+libspreadsheet-read-perl (0.33-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Sat, 24 Jan 2009 03:02:39 +0100
+
 libspreadsheet-read-perl (0.31-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libspreadsheet-read-perl/files/perc.xls
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/files/perc.xls?rev=29998&op=diff
==============================================================================
Binary files - no diff available.

Modified: trunk/libspreadsheet-read-perl/t/20_csv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/20_csv.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/20_csv.t (original)
+++ trunk/libspreadsheet-read-perl/t/20_csv.t Sat Jan 24 02:05:04 2009
@@ -6,7 +6,8 @@
 use Test::More;
 
 use Spreadsheet::Read;
-if (Spreadsheet::Read::parses ("csv")) {
+if (my $parser = Spreadsheet::Read::parses ("csv")) {
+    print STDERR "# Parser: $parser-", $parser->VERSION, "\n";
     plan tests => 117;
     }
 else {

Modified: trunk/libspreadsheet-read-perl/t/30_xls.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/30_xls.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/30_xls.t (original)
+++ trunk/libspreadsheet-read-perl/t/30_xls.t Sat Jan 24 02:05:04 2009
@@ -6,7 +6,9 @@
 use Test::More;
 
 use Spreadsheet::Read;
-if (Spreadsheet::Read::parses ("xls")) {
+my $parser;
+if ($parser = Spreadsheet::Read::parses ("xls")) {
+    print STDERR "# Parser: $parser-", $parser->VERSION, "\n";
     plan tests => 217;
     }
 else {
@@ -25,6 +27,7 @@
     open my $xls, "<", "files/test.xls" or die "files/test.xls: $!";
     binmode $xls;
     $content = <$xls>;
+    close   $xls;
     }
 
 my $xls;
@@ -97,11 +100,12 @@
     }
 
 eval {
-    eval "use Spreadsheet::ParseExcel::FmtDefault";
+    eval "use ".$parser."::FmtDefault";
     my ($pm) = map { $INC{$_} } grep m{FmtDefault.pm$}i => keys %INC;
-    if (open PM, "<", $pm) {
+    if (open my $ph, "<", $pm) {
 	my $l;
-	$l = <PM> for 1 .. 68;
+	$l = <$ph> for 1 .. 68;
+	close $ph;
 	if ($l =~ m/'C\*'/) {
 	    print STDERR "\n",
 			 "# If the next tests give warnings like\n",
@@ -111,11 +115,10 @@
 			 "# patch -p0 <SPE68.diff\n";
 	    my @patch = <DATA>;
 	    s/\bPM\b/$pm/ for @patch;
-	    open  PATCH, ">", "SPE68.diff" or die "SPE68.diff: $!\n";
-	    print PATCH @patch;
-	    close PATCH;
+	    open  $ph, ">", "SPE68.diff" or die "SPE68.diff: $!\n";
+	    print $ph @patch;
+	    close $ph;
 	    }
-	close PM;
 	}
     };
 

Modified: trunk/libspreadsheet-read-perl/t/35_perc.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/35_perc.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/35_perc.t (original)
+++ trunk/libspreadsheet-read-perl/t/35_perc.t Sat Jan 24 02:05:04 2009
@@ -25,5 +25,5 @@
     is ($ss->{attr}[3][$row]{type}, "percentage",	"Type C$row percentage");
 
     my $i = int $ss->{"A$row"};
-    is ("$i%", $ss->{"B$row"},		"Formatted values for row $row\n");
+    is ($ss->{"B$row"}, "$i%",		"Formatted values for row $row\n");
     }

Modified: trunk/libspreadsheet-read-perl/t/40_sxc.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/40_sxc.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/40_sxc.t (original)
+++ trunk/libspreadsheet-read-perl/t/40_sxc.t Sat Jan 24 02:05:04 2009
@@ -6,7 +6,8 @@
 use Test::More;
 
 use Spreadsheet::Read;
-if (Spreadsheet::Read::parses ("sxc")) {
+if (my $parser = Spreadsheet::Read::parses ("sxc")) {
+    print STDERR "# Parser: $parser-", $parser->VERSION, "\n";
     plan tests => 301;
     }
 else {
@@ -18,6 +19,7 @@
     open my $xml, "<", "files/content.xml" or die "files/content.xml: $!\n";
     binmode $xml;
     $content = <$xml>;
+    close   $xml;
     }
 
 {   my $ref;

Modified: trunk/libspreadsheet-read-perl/t/45_ods.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/45_ods.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/45_ods.t (original)
+++ trunk/libspreadsheet-read-perl/t/45_ods.t Sat Jan 24 02:05:04 2009
@@ -18,6 +18,7 @@
     open my $xml, "<", "files/content.xml" or die "files/content.xml: $!\n";
     binmode $xml;
     $content = <$xml>;
+    close   $xml;
     }
 
 {   my $ref;

Modified: trunk/libspreadsheet-read-perl/t/50_sc.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/50_sc.t?rev=29998&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/50_sc.t (original)
+++ trunk/libspreadsheet-read-perl/t/50_sc.t Sat Jan 24 02:05:04 2009
@@ -6,7 +6,8 @@
 use Test::More;
 
 use Spreadsheet::Read;
-if (Spreadsheet::Read::parses ("sc")) {
+if (my $parser = Spreadsheet::Read::parses ("sc")) {
+    print STDERR "# Parser: $parser-", $parser->VERSION, "\n";
     plan tests => 48;
     }
 else {
@@ -25,6 +26,7 @@
     open my $sc, "<", "files/test.sc" or die "files/test.sc: $!\n";
     binmode $sc;
     $content = <$sc>;
+    close   $sc;
     isnt ($content, undef, "Content is defined");
     isnt ($content, "",    "Content is filled");
     }




More information about the Pkg-perl-cvs-commits mailing list