On Fri, Apr 27, 2001 at 03:28:58PM -0500, Jay Strauss wrote:
> In DBI there is:
> 
>       $ary_ref = $dbh->selectrow_arrayref($statement);
>       @row_ary = $dbh->selectrow_array($statement);
> 
> but only
> 
>       $ary_ref = $dbh->selectcol_arrayref($statement);
> 
> Why??? (i.e why no @col_ary = $dbh->selectcol_array($statement))
> 
> I know how to access the individual elements (i.e. $ary_ref->[0])
> 
> But how do I put it an $ary_ref in a foreach?
> 
> foreach my $name ($ary_ref = $dbh->selectcol_arrayref($statement))
> {
> ...stuff;
> }
> 
> Sure doesn't work

Didn't try this, but off the top of my head:

        foreach $name (@$ary_ref) { ... }

-- 
Henry House
OpenPGP key available from http://hajhouse.org/hajhouse.asc

PGP signature

Reply via email to