From: Ralf Ertzinger Date: Sat, 5 Jan 2008 23:16:04 +0000 (+0100) Subject: - Fix some annoyances for default configs X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=commitdiff_plain;h=5390845618e68d90232d695e28d3056c56d23c04 - Fix some annoyances for default configs - Add debugging to _getval() --- diff --git a/videosite/Base.pm b/videosite/Base.pm index 939e203..8e96585 100644 --- a/videosite/Base.pm +++ b/videosite/Base.pm @@ -5,6 +5,7 @@ package Base; use strict; use Irssi; +use Data::Dumper; sub new { my $class = shift; @@ -62,8 +63,12 @@ sub _prepare_parameters { sub _getval { my $self = shift; my $key = shift; + my $val; - return $self->{'_CONFIG'}->{'option'}->{$key}->{'content'} + $val = $self->{'_CONFIG'}->{'option'}->{$key}->{'content'}; + $self->debug('Returning %s=%s', $key, $val); + + return $val; } sub setval { @@ -88,7 +93,7 @@ sub getconfstr { $p = $self->{'_CONFIG'}->{'option'}->{$k}->{'content'}; $p =~ s/%/%%/g; $s .= sprintf(" %s: %s", $k, $p); - if ($self->{'_CONFIG'}->{'option'}->{$k}->{'content'} == $self->{'_PARAMS'}->{$k}->[0]) { + if ($self->{'_CONFIG'}->{'option'}->{$k}->{'content'} eq $self->{'_PARAMS'}->{$k}->[0]) { $s .= " (default)\n"; } else { $s .= "\n";