Fetching Data - Example 1
#/usr/bin/perl -w
### Load the DBI module
use DBI;
### Connect to the database
$dbh = DBI->connect( ‘dbi:Oracle:DEV’, ‘username’, ‘password’ );
### Prepare and execute the statement
$sth = $dbh->prepare( “SELECT name, type FROM megaliths” );
$sth->execute();
### Fetch the data
while ( @row = $sth->fetchrow_array() ) {
    print "Megalith site $row[0] is a $row[1]\n";
  }
### Disconnect from the database
$dbh->disconnect();
exit;
47