I am so confused as to what you're trying to do
Where does the username/password combination confirming payment come from? Some sort of 3rd party billing site? Is that what this perl script integrates with?
Or does this perl file allow you to set access? Changing a user's usergroup is simple, requiring a few lines of code. Please help me understand this further.
P.S. - I don't particularly like the idea of charging for help