Taking a stab here, I noticed that the sub declaring online users is in a sub called GetOnlineUsers. The WriteUserSession sub calls it to get who is online and write it to a file, but you may need to call it seperately.
require "ubb_library.pl";
Common mistake is putting the script in a different directory than the one you are calling, requiring you to declare the path to the file (just a stupid solution, since I don't know where you put the script. You would get an error if it couldn't find the sub).