"Tim Bunce" <[EMAIL PROTECTED]> writes:

> On Thu, Nov 15, 2001 at 10:50:31PM -0700, Jason E. Stewart wrote:
> > 
> > I was just hoping that someone could tell me if there is some
> > fundamental obstruction in the DBI C API that prohibits using RV's.
> 
> There isn't, but you may create a clash with future DBI enhancements.
> A way round that would be to bless the ref into a class and use that
> to trigger the behaviour you want when binding input values. 

Hey Tim,

Thanks for answering.

I'm confused about this. You're suggesting that when I pass data
either using execute(@args) or bind_param(...), that I pass blessed
refs when I use array refs. And then I would code the driver to invoke
some method on that class, like say serialize(), to do what I want?

Seems like an irritating overhead:

  my @array = some_list_function();
  my $scalar = some_scalar_function();
  $sth->execute($scalar, bless(\@array, 'DBD::Pg::float_array'));

When I could just do: 

  $sth->execute($scalar, \@array);

> For out put values then returning an array ref would be fine, though
> I'd still recommend blessing it.

>From the output side, getting back a blessed array ref is no different
from getting an array ref, but what is the advantage to blessing it?

Thanks,
jas.

Reply via email to