Hi Monks!
Need to associate these values, I guess by the "ACCOUNT" value in each array, but I can’t figure it out the best way to do it.
#!/usr/bin/perl
use strict;
use warnings;
use HTML::Template;
use Data::Dump 'pp';
use Data::Dumper;
my @princ;
push @princ, (
{ACCOUNT=>'accountOne',NAME=>'name1',QDT=>'qdt1'},
{ACCOUNT=>'account2',NAME=>'name2',QDT=>'qdt2'},
{ACCOUNT=>'account3',NAME=>'name3',QDT=>'qdt3'},
);
my @type = ();
push @type, (
{HOME_NUMBER=>'house for first account',YEAR=>'year for
+forst account',MONTH=>'the month for the first account', ACCOUNT=>'ac
+countOne',},
{HOME_NUMBER=>'house sec account',YEAR=>'year for the second
+',MONTH=>'month for the second', ACCOUNT=>'account2',},
{HOME_NUMBER=>'house for the 3rd account', YEAR=>'year for 3
+',MONTH=>'month for the third', ACCOUNT=>'account3',},
);
my @person = ();
push @person, (
{PERSON_ID=>'this is the id for the first account',PE
+RSON=>'and the person for the first account',DATE=>'also the date for
+ the first account', ACCOUNT=>'accountOne',},
{PERSON_ID=>'id for the sec2',PERSON=>'This is the person2',DA
+TE=>'The date forthe sec', ACCOUNT=>'account2',},
{PERSON_ID=>'The id3',PERSON=>'person data for the third acc',
+DATE=>'The date matches the Third account', ACCOUNT=>'account3',},
);
my @data=();
my @n_type=();
my @n_person=();
my $n;
for my $p (@princ){
++$n;
# In this block, I am stuck
for my $i (1..$n){
push @n_type, \@type;
push @n_person, \@person;
};
push @data,
{ PRINC =>1,PRINC_DATA => [$p],
TYPE =>1,TYPE_DATA => \@n_type,
PERSON=>1,PERSON_DATA=> \@n_person
};
}
# Create and Load Template
my $template_tmpl = HTML::Template->new( filehandle => \*DATA, die_on_
+bad_params => 1);
$template_tmpl->param( DATA => \@data );
...
Thanks for looking!