#################################################################
# ReadDBM
# Author: Jey Balachandran
#################################################################

package ReadDBM;

sub read_num {
    $which = @_;

	my %stats = ();
	dbmopen (%stats, "dexile_stats", 0777);
	$name = $stats{name};
	@name = split(/~/, $name);
	$pass = $stats{pass};
	@pass = split(/~/, $pass);
	$nums = $stats{nums};
	@nums = split(/~/, $nums);
	$mail = $stats{mail};
	@mail = split(/~/, $mail);
	$class = $stats{class};
	@class = split(/~/, $class);
	$align = $stats{align};
	@align = split(/~/, $align);
	$str = $stats{str};
	@str = split(/~/, $str);
	$dex = $stats{dex};
	@dex = split(/~/, $dex);
	$con = $stats{con};
	@con = split(/~/, $con);
	$int = $stats{int};
	@int = split(/~/, $int);
	$wis = $stats{wis};
	@wis = split(/~/, $wis);
	$cha = $stats{cha};
	@cha = split(/~/, $cha);
	$hp = $stats{hp};
	@hp = split(/~/, $hp);
	$sp = $stats{sp};
	@sp = split(/~/, $sp);
	$weight = $stats{weight};
	@weight = split(/~/, $weight);
	$weight_max = $stats{weight_max};
	@weight_max = split(/~/, $weight_max);
	$weapon = $stats{weapon};
	@weapon = split(/~/, $weapon);
	$armour = $stats{armour};
	@armour = split(/~/, $armour);
	$kills = $stats{kills};
	@kills = split(/~/, $kills);
	$deaths = $stats{deaths};
	@deaths = split(/~/, $deaths);
	$turns = $stats{turns};
	@turns = split(/~/, $turns);
	$gold = $stats{gold};
	@gold = split(/~/, $gold);
	$attacks = $stats{attacks};
	@attacks = split(/~/, $attacks);
	$skills = $stats{skills};
	@skills = split(/~/, $skills);
	$rank = $stats{rank};
	@rank = split(/~/, $rank);
	$rep = $stats{rep};
	@rep = split(/~/, $rep);
	$bounty = $stats{bounty};
	@bounty = split(/~/, $bounty);
	$exp = $stats{exp};
	@exp = split(/~/, $exp);
	$guild = $stats{guild};
	@guild = split(/~/, $guild);
	$messages = $stats{messages};
	@messages = split(/~/, $messages);
	$last_on = $stats{last_on};
	@last_on = split(/~/, $last_on);
	$last_turn = $stats{last_turn};
	@last_turn = split(/~/, $last_turn);
	$last_chat = $stats{last_chat};
	@last_chat = split(/~/, $last_chat);
	@data = (@name[$which-1], @pass[$which-1], @nums[$which-1], @mail[$which-1], @class[$which-1], @align[$which-1], @str[$which-1], @dex[$which-1], @con[$which-1], @int[$which-1], @wis[$which-1], @cha[$which-1], @hp[$which-1], @sp[$which-1], @weight[$which-1], @weight_max[$which-1], @weapon[$which-1], @armour[$which-1], @kills[$which-1], @deaths[$which-1], @turns[$which-1], @gold[$which-1], @attacks[$which-1], @skills[$which-1], @rank[$which-1], @rep[$which-1], @bounty[$which-1], @exp[$which-1], @guild[$which-1], @messages[$which-1], @last_on[$which-1], @last_turn[$which-1], @last_chat[$which-1])
dbmclose (%stats);

    return @data;
}               

#+---------------------------------------------------------------------------------------------
1;       # End of Module
#+---------------------------------------------------------------------------------------------