my $sth = $dbh->prepare("insert into t (foo,bar) values (?,?)"); $sth->execute("foo", 1); $sth->execute("bar", 2); $sth->execute("baz", 3); #### while (my $record = $sth->fetchrow_hashref) { # Manipulate record as needed $record->{'foo'} = &bar( $record->{'baz'} ); push @records, $record; }