package KEYDATA;

$VERSION = "0.01";

1;

sub load
{
	my($self) = {};
	my($section) = "_INIT";
	$filename = shift;
	open(CONFIG, "< $filename");
	while(<CONFIG>)
	{
		s/^\s+//g;
		s/\s+$//g;
		if(/^[A-Za-z]/)
		{
			my($keyword, $value) = split('=', $_, 2);
			$keyword = lc($keyword);
			$keyword =~ s/\s+//g;
			$value =~ s/^\s+//g;
			if($value =~ /^\"/)
			{
				$value =~ s/^\"//;
				$value =~ s/\"$//;
			}
			if($value =~ /^\'/)
			{
				$value =~ s/^\'//;
				$value =~ s/\'$//;
			}
			eval "\$$section\{$keyword\}=\$value";
		}
		if(/^\[/)
		{
			s/^\[//;
			s/\]$//;
			$section = uc($_);
			$section =~ s/\s+//g;
		}
		
	}
	close(CONFIG);
}
