use MPV::Simple; my $ctx = MPV::Simple->new(); $ctx->set_wakeup_callback(\&func); $ctx->initialize(); $ctx->command(); exit 0; sub func {print "callback called \n"}