#!/mit/perl5/bin/perl -wT

use lib "/mit/marthag/lib/site_perl/5.6.0/";
use lib "/mit/marthag/lib/lib/site_perl/5.6.1/";
use lib "/mit/marthag/share/site_perl/5.6.0";
use lib "/mit/marthag/share/perl5.6.0/";
use lib "/mit/marthag/lib/perl5/site_perl/5.6.1";
use lib "/mit/marthag/lib/perl5/5.6.1/sun4-solaris/";

#use Thokbook;
#use Net::Amazon;
# use Log::Log4perl qw(:easy);
# Log::Log4perl->easy_init($DEBUG);

use Palm::PDB;
use Palm::ListDB;
my $pdb = new Palm::ListDB;
$pdb->Load("Thokbook.PDB");

#$dbh = Thokbook::connect_db;

#print @{$pdb->{"records"}};
for $rec (@{$pdb->{"records"}}) {


$auth = $rec->{field1};
$title = $rec->{field2};
$note = $rec->{note};

#print "$auth\n";
#print "$title\n"; 
#print "$note\n";
@line = split /\n/,$note;
@i = split /: /,$line[0];
@s = split /: /,$line[1];
$isbn = $i[1];
$shelf = $s[1];

print "$isbn,$shelf\n";
#system("/bin/athena/tcsh","/mit/marthag/bin/thokbook","add_item",$isbn,$shelf);

#Thokbook::add_item($dbh, $code, $shelf,"1")&&Thokbook::add_asin($dbh,$code);

}

#$dbh->disconnect;
