note
cees
<p>Scalar context works as well according to the DBI source code:</p>
<code>
sub selectrow_array {
my $row = _do_selectrow('fetchrow_arrayref', @_) or return;
return $row->[0] unless wantarray;
return @$row;
}
</code>
<p>The docs hint that this should work as well, but don't explicitly state it. Instead the docs mention this:</p>
<blockquote><i>If called in a scalar context for a statement handle that has more than one column, it is undefined whether the driver will return the value of the first column or the last. So don't do that.</i></blockquote>
<p>Anyway, it won't hurt to add the brackets in there to force list context, but it shouldn't be required.</p>
565865
565969