For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > March 2005 > Trying to get HTML::FillnFORM to fill in my form.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trying to get HTML::FillnFORM to fill in my form.
mortgages2005@aol.com

2005-03-25, 3:55 pm

Hello! I have a file (flatfile) which has two lines to it containing
all the keys on line one and all the values on line two. I have put
this into a hash called hash. I'm trying to populate the fields of my
form with this data. This is the original data keyed in by someone.
There are 300+ fields in the form. Is anyone familiar with
HTML::FillinForm? I found another one called HTML::Defaultify but it's
not on my server as an installed module of perl. This module below is
supposed to "automagically" populate the fields on my form. It's not
working.


#!/usr/bin/perl -w
use HTML::FillInForm;
open (FILE, "../temp/tempdatabase.txt") or error("Can't open file!");
my @descr =<FILE>;
close FILE;
my %hash=();
my @keys=split(/\|/,$descr[0]);
my @values=split(/\|/,$descr[1]);
@hash{@keys} = @values;
print "Content-type: text/html\n\n";
while (($k, $v) = each %hash) {print "$k=>$v,"};
$html="../form1/loanapp.htm";
$fif = new HTML::FillInForm;
$output = $fif->fill(scalarref => \$html,
hash => \%hash);

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com