#!/usr/bin/perl -w use strict; use DBI; use Benchmark; my $dbh=DBI->connect("DBI:CSV:f_dir=c:\\\\pdox") || die "opening connection: $DBI::errstr; stopped\n"; my $sql='SELECT * FROM exp'; my $sth=$dbh->prepare($sql) || die "preparing $sql: $DBI::errstr stopped\n"; sub by_bind { my @res=(0 .. 5); $sth->execute() || die "executing $sql: $DBI::errstr stopped\n"; $sth->bind_columns(\$res[0], \$res[1], \$res[2], \$res[3], \$res[4], \$res[5]); while($sth->fetch()){} } sub by_arrayref { my @result = (0 .. 5); $sth->execute() || die "executing $sql: $DBI::errstr stopped\n"; while($sth->fetchrow_arrayref(\@result)){} } timethese(100, {'bind' => \&by_bind, 'arrayref' => \&by_arrayref}); $dbh->disconnect();