Tom Phoenix wrote:
> On 11/27/07, Steve Bertrand <[EMAIL PROTECTED]> wrote:
> 
>> The current setup feels very 'kludgy' to me. The code snip below comes
>> out of the module. I hope there is enough context to see why I think it
>> can be improved.
> 
> Actually, the snippet you submitted seems pretty straightforward. It
> could be improved (what code couldn't?) but it's not in *need* of
> improvement, IMHO: It can't become impressively faster or clearer.
> What seems kludgy about it? What improvement are you seeking?

Well, I didn't like the fact I was returning an AoA. I have subsequently
changed the code to only allow a single row return, and assign it
directly to $self via a hashref instead:


-- snip --

        while (my $service_info = $query->fetchrow_hashref) {

                for my $field (keys %$service_info) {
                        $self->{$field} = $service_info->{$field};
                }
        }

-- end snip --

Thanks for your response Tom!

Steve

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to