$cb is the callback that will be called once the form has been submitted and either an error or success was received. The first argument to the callback will be the AnyEvent::XMPP::Ext::Registration object, the second will be a boolean value that is true when the form was successfully transmitted and everything is fine. If the second argument is false then the third argument is a AnyEvent::XMPP::Error::Register object. If the error contained a data form which is required to successfully make the request then the fourth argument will be a AnyEvent::XMPP::Ext::RegisterForm which you should fill out and send again with submit_form.