in reply to Re^2: IO::Async::Loop in multiple modules all loaded
in thread IO::Async::Loop in multiple modules all loaded

using $loop->stop and $loop->run is totally wrong

You said the modules were run sequentially, so not definitively wrong. But I prefer a solution that doesn't use that approach if possible.

use Syntax::Keyword::Defer;

If you have Perl 5.36+, you can use use experimental qw( defer ); for the builtin version. (Syntax::Keyword::Defer was a proving ground for the builtin feature, I believe.)

Updated to reflect that it's still experimental.