And with 5.10 there is given/when
given ( $n ) { when ( 1 ) { $s = 'one'; } when ( 2 ) { $s = 'twe'; } when ( 3 ) { $s = 'three'; } when ( 4 ) { $s = 'four'; } default { $s = 'ETOOBIG'; } }
- doug
In reply to Re^2: in search of a more elegant if then else
by doug
in thread in search of a more elegant if then else
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |