- or download this
if ( grep { $ref == $_ } 1..8 ) { ... }
- or download this
if ( $ref >= 1 and $ref <= 8 ) { ... }
- or download this
if ( $ref =~ /^[1-8]$/ ) { ... }
- or download this
use v5.10;
use strict;
...
default { say "ELSE $ref" }
}
}
- or download this
A 1
B 9
C 17
D 25
ELSE 33