package conf;

sub var_read
{
    my ($classname,$path)=@_;
    my ($self)={};
    bless($self,$classname);
    open(my $conf_file,$path);
    while(<$conf_file>)
    {
        s/#.*//;
        if(/^(\s)*$/) {next;}
        chomp;
	if(/\[(.*)\]/) {$section=$1;next;}
        my @fields=split;
        $self->{"$section.$fields[0]"}=$fields[1];
    }
    close($conf_file);
    return $self;
}

sub get_binary
{
    my ($self,$n)=@_;
    my @array=();
    my $m;
    my $i;
    for $i (0..7)
    {
    $m=$n;
    $n=$n>>1;
    $n=$n<<1;
    $array[$i]=$m-$n;
    $n=$n>>1;
    }
return @array;
}

1;