in reply to Tidy up conditions
Note that this assumes your %access hash does not contain boolean false values, as your initial solution did. To actually check for the presence of these keys in the hash, the exists function will help.$level = $access{$item} || $item =~ /^([^:]+):/ && $access{"$1:*"} || $access{'*'} || 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tidy up conditions
by tel2 (Pilgrim) on Mar 19, 2015 at 02:01 UTC | |
by SuicideJunkie (Vicar) on Mar 19, 2015 at 20:09 UTC | |
by tel2 (Pilgrim) on Mar 19, 2015 at 23:50 UTC | |
by martin (Friar) on Mar 20, 2015 at 03:43 UTC | |
by tel2 (Pilgrim) on Mar 20, 2015 at 05:23 UTC | |
by tel2 (Pilgrim) on Mar 21, 2015 at 01:35 UTC | |
|