You can pass data from an script to another in several ways:
- Using environment variables
- Using the program argument list
- Saving the data to a file on disk
- Pasing the data through STDIN/STDOUT or other shared pipes
- Using shared memory
- etc...
Regarding how to launch the script B, you can just use system.
Anyway, if you describe us the real problem you are trying to solve in detail, we would be able to give you more accurate help.