SWITCH: for ($where) {
/Kitchen/ && do { push @flags, '-e'; last; };
/Lounge/ && do { push @flags, '-h'; last; };
/Porch/ && do { last; };
die "unknown value for variable where: `$where'";
}
|
< Using A Hash Instead of $$name Switch by Using do{} Creatively > Table of Contents | Page 24 |
YAPC 19101,
June 2001 Perl Idioms Nathan Torkington |