in reply to Re^3: checking values of variables
in thread checking values of variables

I decided to stay with what I have (because the scalar variables are used all over the program and I didn't want to do a great deal of editing). However, next time I have this situation I will most likely use:
for (qw / server database user password ... initversion /) { help() and last unless (defined $cfg->params($_) and $cfg->params +($_));
and use $cfg->params(server) instead of $server Thanks to all (Perl Monks is fantastic!)

Replies are listed 'Best First'.
Re^5: checking values of variables
by fionbarr (Friar) on Aug 13, 2013 at 13:56 UTC
    however, this approach does not allow
    $mail_host = $cfg->param('mail_host') || 'mail@xxx.org'; $support_addr = $cfg->param('support_addr') || 'support@xxx.org' +;
    default values.