in reply to Picking a Template Engine/Method

Thanks for the replies. hollie's reply sent me down what I hope will be the right path. I am defining the layout line by line in a perl data structure that is mostly human readable.

1 => [ [50, 26, "Ins Company Name" , ""]], 2 => [ [50, 26, "Ins Street Address" , ""]], 3 => [ [50, 26, "Ins Street Address 2", ""]], 4 => [ [50, 12, "Ins City" ,""], [64, 2, "Ins State",""], [67, 5, "Ins Zip" ,""], ], 6 => [ [57, 22, "Unknown", ""]], 8 => [ [ 1, 1, "Medicare" ,"" , '1'], [ 8, 1, "Medicade" ,"" , '1'], [15, 1, "Champus" ,"" , '1'], [24, 1, "Champva" ,"" , '1'], [31, 1, "Group Health Plan" ,"" , '1'], [39, 1, "FECA BLK LUNG" ,"" , '1'], [45, 1, "Other" ,"" , '1'], [50, 17, "Insured's I.D. Number" ,"" , '1a'], ],

I then wrote a fairly simple script that translates this into the X format for comparison/verification pourposes. Here is my quick little script which will be refined some more.

my $hcfa = do "hcfa.lay"; my $layout = []; foreach my $line ( sort keys %$hcfa ) { foreach my $item ( @{$hcfa->{$line}} ) { insert_into_layout($layout, $line, $item->[0], "X" x $ +item->[1]); } } print layout_form($layout); sub insert_into_layout { my ($layout, $line, $row, $value) = @_; my @data = split //, $value; my $offset = 0; foreach ( @data ) { $layout->[$line][$row + $offset++] = $_; } } sub layout_form { my $layout = shift; my $output; foreach my $row (@$layout) { foreach my $val (@$row) { $output .= (defined $val ? $val : ' '); } $output .= "\n"; } return $output; }

I plan on linking the 4th feild in that definition file to the database in some as yet undefined way. Maybe coderefs in some cases and plain scalars of the database feild in others. Either way I think this gets the best of both worlds. Thanks agian!


___________
Eric Hodges