Pug has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (subroutines)
I'm using IniConf which returns undefined if the section
does not exist. I have found that this works but it is
painful to read:
Is there a better way?if ( ! my $temp = $cfg->val("MISC","HASHTYPE") ) { $CONFIG{HASHTYPE}="sha1"; } else { $CONFIG{HASHTYPE}=$temp; }
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to deal with undefined returned variables.⭐
by knight (Friar) on Jan 19, 2001 at 21:55 UTC | |
Re: How to deal with undefined returned variables.⭐
by davorg (Chancellor) on Jan 19, 2001 at 21:54 UTC | |
Re: How to deal with undefined returned variables.
by Russ (Deacon) on Mar 05, 2002 at 19:51 UTC | |
by rinceWind (Monsignor) on Mar 06, 2002 at 17:00 UTC | |
Re: How to deal with undefined returned variables.
by Boldra (Deacon) on Dec 09, 2008 at 10:23 UTC |
Back to
Seekers of Perl Wisdom