# assume $bot is a valid Net::OSCAR object # callbacks $bot->set_callback_signon_done(\&signon_done); $bot->set_callback_buddylist_ok(\&buddylist_ok); $bot->set_callback_buddylist_error(\&buddylist_error); $bot->signon($sn,$passwd); #this logs you into the net # Program should wait here until signon_done # parse a list of @buddies to be added (this works) foreach (@buddies) { $bot->add_buddy($grp, $_) #adds a user $bot->commit_buddylist(); # sets changes to the server # program should wait here until either # buddylist_ok() or buddylist_error() is returned } # ... do other stuff