in reply to Re: Help with Spreadsheet::ParseExcel
in thread Help with Spreadsheet::ParseExcel

Hi, it didn't make any difference with or without CGI, I fixed the "die" method as well, but I still have the problem with the code I posted, any suggestion?
#!/usr/bin/perl -w use strict; use CGI qw( -oldstyle_urls :standard ); use CGI::Carp qw ( fatalsToBrowser ); use Spreadsheet::ParseExcel; my $f_to_parse = "accounts.xls"; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse($f_to_parse); #my $workbook = Spreadsheet::ParseExcel::Workbook->Parse($f_to_parse)o +r die "Unable to open $f_to_parse\n"; if ( !defined $workbook ) { die "Got error code ", $parser->error_code, ".\n"; } for my $sheet (@{$workbook->{Worksheet}}) { print "Sheet: ", $sheet->{Name}, "\n"; } #Result: #Sheet: Sheet1 #Sheet: Sheet2 #Sheet: Sheet3

Thanks!

Replies are listed 'Best First'.
Re^3: Help with Spreadsheet::ParseExcel
by toolic (Bishop) on Jan 11, 2011 at 19:49 UTC
    Great. So, you proved that something will get printed. Now, start adding your lines of code back in and debug with print statements to see where things start going wrong. Refer to the Basic debugging checklist for other tips.