DBI: selectrow_array() return first column when called in list context

"[email protected]" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <CAOqrB6YK3f3259F5o3snHeJQDQDbcMmsAeY-QbCaCt7Zexa4hg@mail.gmail.com>
Hi

I need to understand why selectrow_array() return only one column (first
column) when called in list context as in the code below. On the otherhand
selectrow_arrayref behaves correctly.

code
=====

if ($x){
        print "When using selectrow_array(), DBI returned:";
        print "\$x: $x \$y: $y";

        print "\n\n";
}else{
        print "DB returned no data\n\n";

}

selectrow_arrayref behaves correctly.

my ($arrref) = $dbh->selectrow_arrayref(qq{
SELECT user,perm FROM access
WHERE token=\'Tt9VpStL4xADSDJQtd4AkMc6cVi66Mwmr9pMcCRgO4NVJ\'})|| die
"Could not query database:  $DBI::errstr\n";

my @retarr = @$arrref;

if (@retarr){
        print "When using selectrow_arrayref, DBI returned:";
        print "\@retarr contains: @retarr ";

        print "\n\n";
}else{
        print "DB returned no data\n\n";

}


Output
=========
perl misc_test.pl
Use of uninitialized value $y in concatenation (.) or string at
misc_test.plline 69.
When using selectrow_array(), DBI returned:$x: markb $y:

When using selectrow_arrayref, DBI returned:@retarr contains: markb ro


Installed versions
============
perl -MDBD::mysql -le 'print $DBD::mysql::VERSION;'
4.013
 perl -MDBI -le 'print $DBI::VERSION;'
1.609
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.