Skip Menu |

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

Report information
The Basics
Id: 22050
Status: open
Priority: 0/
Queue: Spreadsheet-ParseExcel-Simple

People
Owner: Nobody in particular
Requestors: REMORSE [...] PARTNERS.ORG
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Ability to pass separate formatters?
Date: Thu, 12 Oct 2006 10:00:56 -0400
To: bug-Spreadsheet-ParseExcel-Simple [...] rt.cpan.org
From: Richard Morse <REMORSE [...] PARTNERS.ORG>
Hi! I'm running into an issue where a spreadsheet has unicode characters in it, and there is no way using Spreadsheet::ParseExcel::Simple to pass a unicode formatter to Parse. Could this be added as an optional parameter? Thanks, Ricky
Subject: Re: [rt.cpan.org #22050] possible solution
Date: Thu, 12 Oct 2006 10:07:27 -0400
To: bug-Spreadsheet-ParseExcel-Simple [...] rt.cpan.org
From: Richard Morse <REMORSE [...] PARTNERS.ORG>
BTW: to solve this problem (which spews a ton of warnings to the console, and thus via CGI::Carp back to people who wouldn't understand a word of it), I rewrote read as follows: sub read { my $class = shift; my ($file, $formatter) = @_; my $book; if (defined($formatter)) { $book = Spreadsheet::ParseExcel->new->Parse($file, $formatter) or return; } else { $book = Spreadsheet::ParseExcel->new->Parse($file) or return; } bless { book => $book }, $class; } This allows you to use it like: use Spreadsheet::ParseExcel::Simple; use Spreadsheet::ParseExcel::FmtUnicode; my $xls = Spreadsheet::ParseExcel::Simple->read($filename, Spreadsheet::ParseExcel::FmtUnicode->new());
Subject: Re: [rt.cpan.org #22050] possible solution
Date: Thu, 12 Oct 2006 17:13:41 +0100
To: bug-Spreadsheet-ParseExcel-Simple [...] rt.cpan.org
From: Tony Bowden <tony [...] tmtm.com>
Richard Morse via RT wrote: Show quoted text
> my $xls = Spreadsheet::ParseExcel::Simple->read($filename, > Spreadsheet::ParseExcel::FmtUnicode->new()); >
I don't really like optional arguments like this being passed positionally. If you make it work via an options hash, and can provide a test case, I'll apply it. Thanks, Tony