I am creating a phone directory and would like to display the entire
contents of the database ordered by last name utilizing the
HTML:Template module. I am not sure the code that I have so far will
work as I have planned as this is my first time ever using an array of
hashes. How can I be sure, using the code that I have so far, that my
order by last name will preserved once displayed in the template???
Here's my code:
sub displayphone {
#Retrieve current state of the object
my $self = shift;
#Shortcut to return a reference to an array of hash elements
my %attr = ( dbi_fetchall_arrayref_attr => {});
#Preparing the template and substitute the values
my $template = HTML::Template->new(filename =>
'displayphone.tmpl');
$template->param(ROWS => $dbh->selectall_arrayref("SELECT * FROM
directory ORDER BY lastname", \%attr, $value),);
#Display results
return $template->output;
}
Thanks in advance....I am a Perl newbie,
derek
Derek Ash
Application Programmer II
University of Illinois College of Medicine at Peoria
One Illini Drive, Box 1649
Peoria, Illinois 61656-1649
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>