given($total_earnings) { when($_ <= 14_000) { $rate = 10.5; } when($_ <= 48_000) { $rate = 17.5; } when($_ <= 70_000) { $rate = 30.0; } default { $rate = 33.0; } };
- continue - drop through for more matches
- break - exits ‘given’ block
given($total_earnings) { when($_ <= 14_000) { $rate = 10.5; } when($_ <= 48_000) { $rate = 17.5; } when($_ <= 70_000) { $rate = 30.0; } default { $rate = 33.0; } };