Perl 6 An Introduction to Perl 6 #25

Given / when ('switch' statements)

Perl 5 doesn't have a 'switch' statement.

Perl 6 uses 'given' and 'when':

given EXPR {
   when EXPR { ... }
   when EXPR { ... }
   default { ... }
}
Copyright © 2008 Patrick Michaud