in reply to Net::Jabber: Receiving answers without callbacks

not sure about using messages... can you make your query/reponse into 'iq' packets? maybe this will work with messages also, i just haven't tried. this is from a bot that gets a list of users in chatrooms.
while (1) { $count_rooms = 0; %count_users = (); open $html, '>:utf8', 'chatters.html'; print $html qq{<h2>Currently in Chatrooms</h2>\n<ul>\n}; my $Rep; $Rep = $Connection->SendAndReceiveWithID( new_get_iq($ME, $CS, $NS_D_ITEMS), 10); rep_dump( $Rep ); print $html qq{</ul>\n}; close $html; print "Count: $count_rooms rooms, ",scalar(keys %count_users), +" users\n" ; sleep(60); }
the SendAndReceiveWithID function will send the IQ Query and wait for the IQ Response before continuing.