# Create a select statement to get this data from the table my $selectStatement = "SELECT "; $selectStatement .= join(', ',@fieldNames) ; # Add fields seperated by commas $selectStatement .= " FROM ./POIS.dbf"; # Add the dbf file print "$selectStatement\n\n\n" if $debugFlag; # Get handle by opening the .dbf file which has POI info in it my $dbh = DBI->connect("DBI:XBase:$directory") or die $DBI::errstr; my $sth = $dbh->prepare(" $selectStatement ") or die $DBI::errstr; $sth->execute() or die $sth->errstr(0);