Is there a simple example coding of actual usage that you can show me?
I'm not familiar with these modules.
Main Topics
Browse All TopicsI have an existing Excel template file, and I would like to update it via web form.
How can this be done?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
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:
foo.xml
<config logdir="/var/log/foo/" debugfile="/tmp/foo.debug"
<server name="sahara" osname="solaris" osversion="2.6">
<address>10.0.0.101</addre
<address>10.0.1.101</addre
</server>
<server name="gobi" osname="irix" osversion="6.5">
<address>10.0.0.102</addre
</server>
<server name="kalahari" osname="linux" osversion="2.0.34">
<address>10.0.0.103</addre
<address>10.0.1.103</addre
</server>
</config>
the outline of a script to get the file into a form:
foo.pl
#!perl
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_html,
$q->start_form(-action => 'update.pl');
foreach my $fields (@fields) {
print "$fields: ",
$q->textfield(-name=>$fiel
-default=>$config->{$field
-size=>50,
-maxlength=>80),
'<br />';
}
print $q->submit(),
$q->end_form,
$q->end_html;
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***
Business Accounts
Answer for Membership
by: Perl_DiverPosted on 2006-05-17 at 16:27:30ID: 16704837
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.
hor/GRANTM /XML-Simpl e-2.14/lib /XML/ Simpl e.pm hor/RKINYO N/Excel-Te mplate-0.2 5/ lib/Exce l/Template .pm
http://search.cpan.org/aut
http://search.cpan.org/aut