sub doConf { my ($conf, %directives) = @_; while (($directive, $variable) = each(%directives)) { if ($directive eq "Servers") { %$variable = $conf->get($directive); } else { $$variable = $conf->get($directive); } } } # # string abbreviate (string thestring[, int maxlength) # # Returns thestring abbreviated to maxlength-3 characters plus "...", unless # thestring is shorter than maxlength. # sub abbreviate { my ($thestring, $maxlength) = @_; $maxlength = 12 unless ($maxlength); if (length($thestring) > $maxlength) { $thestring = substr($thestring, 0, $maxlength - 3); return "$thestring..."; } else { return $thestring; } } 1;