use strict; use warnings; use CGI qw(:standard); use DBIx::XHTML_Table; my $file = '/path/to/foo.xls'; my $dbh = DBI->connect("DBI:Excel:file=$file",undef,undef,{RaiseError=>1}); my $table = DBIx::XHTML_Table->new($dbh); my $sheet = ($dbh->tables)[0]; $table->exec_query("select * from $sheet"); print header, $table->output;