in reply to default values
If 0 could be proper value (and isn't the default, otherwise the above would still work)$val ||= $default_val;
Dealing with possible undefs and 0 as the state of $val will require it 3 times I think$val = $default_val unless defined $val;
I suspect others might have shorter solns... FORE!$val = $default_val unless defined $val && length($val);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: default values
by BUU (Prior) on Sep 16, 2003 at 05:19 UTC | |
by tachyon (Chancellor) on Sep 16, 2003 at 06:56 UTC | |
by liz (Monsignor) on Sep 16, 2003 at 07:44 UTC | |
by Anonymous Monk on Sep 16, 2003 at 15:20 UTC |