This loop never stops:
class CX::Vaya does X::Control {
has $.message
}
loop {
once {
CX::Vaya.new( message => "I messed up!" ).throw;
}
last;
CONTROL {
default {
say "Controlled { .^name }: { .message }"
}
}
}
It keeps writing
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
Controlled CX::Last: <last control exception>
...
It could be the once
bit, because CONTROL phaser with last does finish:
loop { say "Hey"; last; CONTROL { default: .message.say } }
# OUTPUT: «Hey<last control exception>»
But I'm not really sure.
To eradicate the mold you must destroy 6 green, glowing, mold balls. You can destroy these mold balls by either using your Service Weapon or by launching an object at them. Keep an eye out for any Hiss forces too.
Use undiluted white vinegar on hard surfaces in kitchens and baths. A bleach solution also works to kill mold. Mix one cup of bleach in a gallon of water, apply to the surface and don't rinse. Mix a 50/50 solution of ammonia and water.
The Furnace is a paranatural entity found in the Furnace Chamber in the Maintenance Sector.
Loop flow control in Perl 6 is implemented using control exceptions. Thus, last
is actually throwing a CX::Last
control exception. Since the CONTROL
block uses default
, it is therefore catching the CX::Last
thrown by last
, meaning that control is never transferred out of the loop.
The fix is to instead specify which control exception to catch, using when
:
loop {
once {
CX::Vaya.new( message => "I messed up!" ).throw;
}
last;
CONTROL {
when CX::Vaya {
say "Controlled { .^name }: { .message }"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With