in reply to Splitting a hashref into hashrefs
If they are related, a renaming of variables can be very helpful:
Now, the call to slashDisplay() will be:my $group_info = $slashdb->sqlSelectHashref( # SELECT 'o.org_id, o.name, g.group_id, g.name', # FROM 'groups AS g, orgs AS o', # WHERE "group_id = $group_id AND o.org_id = g.org_id", );
And the template will look like:slashDisplay('group_edit', { group_info => $group_info });
This way, the code remains simple, and the template is perfectly understandable.<p>Org id: [% group_info.org_id %]</p> <p>Org name: [% group_info.org_name %]</p> <p>Group id: [% group_info.group_id %]</p> <p>Group name: [% group_info.group_name %]</p>
Arjen
|
|---|