On Jul 25, Denis N. said:

my $selectHandle = $dbh->prepare(...);
...
$selectHandle->execute(....);
my @data = $selectHandle->fetchrow_array();
$self->[1] =  \$data;

That should be [EMAIL PROTECTED], not \$data.

my $selectHandle = $dbh->prepare(...);
...
$selectHandle->execute(....);
$self->[1] =  $selectHandle->fetchrow_arrayref();

The second one is not correct because it turned out that fetchrow_arrayref()
return reference to the same array (as described in man page).

Yeah.

Is there a syntax for obtaining the reference to the array returned by the
function without copying it first?

Well, since fetchrow_array() returns a list (not an array, and not an array ref), the best you can hope for right now is

  $self->[1] = [ $selectHandle->fetchrow_array() ];

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

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


Reply via email to