use lib '.';
use Top;
Top.new
unit class Top;
has $!rdp = 'bar';
submethod TWEAK {
my $rdp := $!rdp;
for <A B C> {
my $OK = True;
require ::("Plugin::$_");
CATCH { $OK = False; .resume }
::("Plugin::$_").new.enable($rdp) if $OK
}
}
unit class Plugin::A;
method enable($foo) { put "$foo enabled in A" }
unit class Plugin::C;
method enable($foo) { put "$foo enabled in C" }