in reply to Infinite LOOP and reading from STDIN
I did that for a MUD some years ago — the original was written in REXX back in the 80's, out of nostalgia I recreated it in Perl using the old data files. I used IO::Async::Loop for the main event loop.
use IO::Async::Loop; ..... our $loop = IO::Async::Loop->new; $loop->add( IO::Async::Timer::Periodic->new( # This will call the main operational code of Muda: interval => 1, notifier_name => 'MAIN', on_tick => \&mainMudaTick )->start ); ..... $loop->run;
The full code can be found here: https://www.grcrun11.gr/files/
In Section Seekers of Perl Wisdom