Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

use strict; use XML::Excel; my $excel_obj = XML::Excel->new(); eval { my $status =$excel_obj->parse_doc("address1.xls", {headings => + 1}); $excel_obj->print_xml("address1output.xml"); }; if($@) { print $@."\n"; }

I am using Above code to convert Excel to XML.It is Shown error like (Bad File Descriptor).Kindly Help me in this

Senthil

Replies are listed 'Best First'.
Re: Problem in converting Excel to xml
by Khen1950fx (Canon) on Sep 16, 2011 at 06:40 UTC
    XML::Excel is relatively simple. Just keep it simple. Here's what I did:
    #!/usr/bin/perl use strict; use warnings; use XML::Excel; my $excel_obj = XML::Excel->new(); my $xls = '/root/colors.xls'; my $status = $excel_obj->parse_doc("$xls", {headings => 1}); $excel_obj->print_xml("/root/Desktop/out.xml"); if($@) { die "Unable to print xml\n"; }