I like they way I can recognise the comments from the HTML::Template examples ;) I spent a lot of time copying out that example and modifying it too.
Without claiming I know much better, I would probably shorten this bit a little:
my @newfields = (); foreach $field (@fields){ push(@newfields, $field); } while (@newfields) { get_values(); my %nf_row_data; $nf_row_data{FIELD} = shift @newfields; push(@field_data, \%nf_row_data); }
can be written as (untested):
my @newfields = (); foreach $field (@fields){ get_values(); my %nf_row_data; $nf_row_data{FIELD} = $_; push(@field_data, \%nf_row_data); }
But why do you have get_values() there at all? You don't need it, because you have already used @keys and @values, right?
Also it is bad practise to have get_values() modify a global variable. Pass @keys and @values out of the subroutine like this: return \@keys, \@values
Put use strict; at the top of your program, fix all the errors, then post again.
____________________
Jeremy
I didn't believe in evil until I dated it.
In reply to Re: How can I display DBM entries in an HTML table?
by jepri
in thread How can I display DBM entries in an HTML table?
by bladx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |