Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Spreadsheet-ParseExcel CPAN distribution.

Maintainer(s)' notes

If you are reporting a bug in Spreadsheet::ParseExcel here are some pointers

1) State the issues as clearly and as concisely as possible. A simple program or Excel test file (see below) will often explain the issue better than a lot of text.

2) Provide information on your system, version of perl and module versions. The following program will generate everything that is required. Put this information in your bug report.

    #!/usr/bin/perl -w

    print "\n    Perl version   : $]";
    print "\n    OS name        : $^O";
    print "\n    Module versions: (not all are required)\n";

    my @modules = qw(

    for my $module (@modules) {
        my $version;
        eval "require $module";

        if (not $@) {
            $version = $module->VERSION;
            $version = '(unknown)' if not defined $version;
        else {
            $version = '(not installed)';

        printf "%21s%-24s\t%s\n", "", $module, $version;


3) Upgrade to the latest version of Spreadsheet::ParseExcel (or at least test on a system with an upgraded version). The issue you are reporting may already have been fixed.

4) Create a small example program that demonstrates your problem. The program should be as small as possible. A few lines of codes are worth tens of lines of text when trying to describe a bug.

5) Supply an Excel file that demonstrates the problem. This is very important. If the file is big, or contains confidential information, try to reduce it down to the smallest Excel file that represents the issue. If you don't wish to post a file here then send it to me directly:

6) Say if the test file was created by Excel, OpenOffice, Gnumeric or something else. Say which version of that application you used.

7) If you are submitting a patch you should check with the maintainer whether the issue has already been patched or if a fix is in the works. Patches should be accompanied by test cases.

Asking a question

If you would like to ask a more general question there is the Spreadsheet::ParseExcel Google Group.

Report information
The Basics
Id: 12946
Status: resolved
Priority: 0/
Queue: Spreadsheet-ParseExcel

Owner: Nobody in particular
Requestors: gwolf [...]

Bug Information
Severity: Wishlist
Broken in: 0.2603
Fixed in: 0.63


Subject: Allow more flexible filehandle specifications
Download (untitled) / with headers
text/plain 492b
Currently if you pass anything other than a filename or string it errors out. It would be nice if it accepted: a. filehandle (IO::Handle) references (the -e on line 282 prevents this) b. IO::Wrap objects, as returned from many other places. (down around line 370 it needs to test for this and work around the binmode). This wishlist bug report was filed in Debian a long time ago (see The patch is very simple and not invasive.
--- (revision 1033) +++ (working copy) @@ -336,6 +336,7 @@ my($oThis, $sFile, $oWkFmt)=@_; my($sWk, $bLen); + my $ref = ref($sFile); #0. New $oBook my $oBook = Spreadsheet::ParseExcel::Workbook->new; $oBook->{SheetCount} = 0; @@ -343,7 +344,7 @@ #1.Get content my($sBIFF, $iLen); - if(ref($sFile) eq "SCALAR") { + if($ref eq "SCALAR") { #1.1 Specified by Buffer ($sBIFF, $iLen) = $oThis->{GetContent}->($sFile); return undef unless($sBIFF); @@ -353,8 +354,8 @@ # return undef; # } #1.2 Specified by GLOB reference - elsif((ref($sFile) =~ /GLOB/) or - (ref($sFile) eq 'Fh')) { #For (Light FileHandle) + elsif(($ref =~ /GLOB/) or + ($ref eq 'Fh')) { #For (Light FileHandle) binmode($sFile); my $sWk; my $sBuff=''; @@ -364,15 +365,23 @@ ($sBIFF, $iLen) = $oThis->{GetContent}->(\$sBuff); return undef unless($sBIFF); } - elsif(ref($sFile) eq 'ARRAY') { + elsif($ref eq 'ARRAY') { #1.3 Specified by File content $oBook->{File} = undef; my $sData = join('', @$sFile); ($sBIFF, $iLen) = $oThis->{GetContent}->(\$sData); return undef unless($sBIFF); } + elsif (grep {$ref eq $_} qw(IO::File IO::Handle IO::Wrap)) { +#1.4 Specified by IO::File/Handle/Wrap object + $oBook->{File} = undef; + my $sBuff = join('',$sFile->getlines); + ($sBIFF, $iLen) = $oThis->{GetContent}->(\$sBuff); + return undef unless($sBIFF); + } else { -#1.4 Specified by File name +#1.5 Specified by File name $oBook->{File} = $sFile; return undef unless (-e $sFile); ($sBIFF, $iLen) = $oThis->{GetContent}->($sFile);
Download (untitled) / with headers
text/plain 570b
On Tue May 24 15:46:47 2005, guest wrote: Show quoted text
> Currently if you pass anything other than a filename or string it > errors > out. > b. IO::Wrap objects, as returned from many other places.
I am pretty sure IO::Wrap is obsolete these days, and my tests indicate that IO::Handle/IO::File objects do work (perhaps depends on version of perl), but I'm going ahead and implementing a fix anyway. Some CPAN libraries probably do still return IO::Wrap objects...hopefully the handles are already binmode'd because IO::Wrap does not implement binmode (though it probably should).
All resolved in 0.63

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to