On 2005-11-22, Cees Hek <[EMAIL PROTECTED]> wrote:
>
> I have a 'hashref' method in my Class::DBI base class that flattens
> the data into a hashref:
>
> sub hashref {
> my $self = shift;
> die "Unknown column requested" if grep { ! $self->find_column($_) } @_;
> my @cols = @_ ? @_ : $self->columns();
> my %hash;
> @[EMAIL PROTECTED] = map { defined $_ ? "".$_ : undef } $self->get(@cols);
> return \%hash;
> }
It would be great if Class::DBI provided a more optimized version of
this in the first place, since clearly the underlying DBI supports it.
Mark
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]