- or download this
switch ( $foo ) {
case ( tr/I/I/ == 1 ) { $bar = 'low' }
...
case ( tr/I/I/ == 3 ) { $bar = 'high' }
else { warn "Bad $_\n" }
}
- or download this
Use of uninitialized value $_ in transliteration (tr///)
- or download this
#!perl! -w
use strict;
...
}
print "Foo: $foo Bar: $bar\n";
- or download this
given ( $foo ) {
when ( tr/I/I/ == 1 ) { $bar = 'low' }
...
when ( tr/I/I/ == 3 ) { $bar = 'high' }
default { $bar = "drat" }
}