#!/usr/bin/perl -w

use strict;
use DBI;

my $file = shift;

my $dbh = DBI->connect("dbi:MaddenNFL:$file");
die "no dbh: $file" if (!$dbh);

my $cur;
while (<>) {
  chomp;
  s/;$//;
  $cur = $dbh->prepare($_);
  $cur->execute();
  print join("\t", @{$cur->{'NAME'}}), "\n";
  while (my @data = $cur->fetchrow_array()) {
    print join("\t", @data), "\n";
  }
}
$cur->finish();

$dbh->disconnect();

