package conf;
use Tie::File;

sub var_read
{
    my ($classname,$path)=@_;
    my ($self)={};
    bless($self,$classname);
    my @array;
    tie @array, 'Tie::File', $path,mode=>O_RDONLY;
    for(@array)
        {
        if(m/^(\s)*$/) {next;}
        if(m/^#/) {next;}
        chomp;
	if(/\[(.*)\]/) {$section=$1;next;}
        my @fields=split;
        $self->{"$section.$fields[0]"}=$fields[1];
        }
    untie @array;
    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;