From 5390845618e68d90232d695e28d3056c56d23c04 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sun, 6 Jan 2008 00:16:04 +0100 Subject: [PATCH] - Fix some annoyances for default configs - Add debugging to _getval() --- videosite/Base.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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"; -- 1.8.3.1