while (1) { $taxis->taxis(); # move every woodlouse through one cycle DoOneEvent( $running ? DONT_WAIT : ALL_EVENTS ); } #### $mw->repeat( 50, [ sub { $taxis->taxis() if $running } ] ); DoOneEvent( $running ? DONT_WAIT : ALL_EVENTS ) while 1;