write to existing Excel file using Perl under FreeBSD + Perl 5.005_03

I have an existing Excel template file, and I would like to update it via web form.

How can this be done?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you using an XML file for the template? You could probably use XML::Simple to read the XML file and get it into a CGI form you can use to update it with once again useing XML::Simple. Then you can possibly use the Excel::Template module to create the excel file.

jay28leeAuthor Commented:
Is there a simple example coding of actual usage that you can show me?

I'm not familiar with these modules.
Both of the module documentations have code examples. If you don't actually need to create the excel file from the template at the time of the update then there is no need to use the Excel::Templat module at all. I'll use the example from the XML::Simple module, the xml file:


<config logdir="/var/log/foo/" debugfile="/tmp/foo.debug">
  <server name="sahara" osname="solaris" osversion="2.6">
  <server name="gobi" osname="irix" osversion="6.5">
  <server name="kalahari" osname="linux" osversion="2.0.34">

the outline of a script to get the file into a form:


use strict;
use warnings;
use CGI;
use XML::Simple;
#use Data::Dumper;
my $q = new CGI;
my $config = XMLin();
my @fields = qw(logdir debugfile);

print $q->header,
      $q->start_form(-action => 'update.pl');
foreach my $fields (@fields) {
   print "$fields: ",
   '<br />';  
print $q->submit(),

then update.pl gets the form data and reopens the xml file, plugs the new values into the appropriate variables, and saves the data back to the xml file using the XMLout() function. Hope that gets you started.  

***I wish this forum had a preview option***

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.