bind_columns()
$sth->bind_columns(@variables)This function associates or binds columns from a statement
handle to a given list of variables
(@variables). The values are updated when
the related row is retrieved using a fetch method without extra
copying of data. The number of variables given must match the number
of columns selected and the columns are assigned to variables in the
order the columns are returned. Here is an example:
...
my $sql_stmnt = "SELECT title, author FROM books";
my $sth = $dbh->prepare($sql_stmnt);
$sth->execute();
$sth->bind_columns(\$title, \$author);
while($sth->fetch()) {
print "$title by $author \n";
}