### set up default structure sub options { my $self = shift; my $prop = $self->{server}; my $ref = shift; foreach ( qw(port host proto allow deny cidr_allow cidr_deny) ){ if (! defined $prop->{$_}) { $prop->{$_} = []; } elsif (! ref $prop->{$_}) { $prop->{$_} = [$prop->{$_}]; # nicely turn us into an arrayref if we aren't one already } $ref->{$_} = $prop->{$_}; } foreach ( qw(conf_file user group chroot log_level log_file pid_file background setsid listen reverse_lookups syslog_logsock syslog_ident syslog_logopt syslog_facility no_close_by_child no_client_stdout tie_client_stdout tied_stdout_callback tied_stdin_callback leave_children_open_on_hup ) ){ $ref->{$_} = \$prop->{$_}; } }