I suggest that you won't waste time learning what you don't need to use a lot (I think Perl will also help you developing/fixing mods for UBB, while PHP might help you add stuff to the accelerator; but all of them are similar). I suggest you to start with Perl, and if you need something for PHP, just enter their docs at php.net.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.