But why would you have to? Just pass in the SQL and the selected id:
sub make_select { my ($dbh, $sql, $args, $id) = @_; my $items = $dbh->selectall_arrayref($sql, {Slice => {}}, $args); for ($items) { $_->{selected} = 1 if $_->{id} == $id; } return $items; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re^3: abstraction -- level up!
by jeffa
in thread abstraction -- level up!
by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |