Don't worry about it. That's why I'm here. Now, I can't help you with the perl, but consider this:
1) You submit a form to a cgi script. 2) The script is processed and takes the user to pageA.html. 3) IN THIS PAGE, you put the code that I listed for you above, with the one exception that you put the function call in the body tag with an onLoad instead.
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.