#!/usr/bin/perl
my($name, $age);
use DBI;
$dbh = DBI->connect("DBI:mysql:nations", "randy", "password");
$dbh->do("select name from nations where area > 100 order by area");
$sth = $dbh->prepare("select area, name from nations where name > 'z' order by name");
$sth->execute();
$sth->bind_columns(undef, \$name, \$age);
while ($sth->fetch) {
    print "$name $age\n";
}
$dbh->disconnect;
