When your Engine Light comes on, the computer in your car is alerting you with a problem through the sensors located in various locations within your car. If the problem is not corrected soon, it can lead to more serious issues.
The Engine Light is also associated with error code(s) that can help you identify your problem. You can go to your local auto parts store to borrow (buy) an On-Board Diagnostic 2 scanner to determine the error code(s). This handheld device comes with a cable that you plug into a port underneath the drivers dashboard. Once you start your engine, the error codes will show up to help you identify your car problem.
If your gas cap was missing, then there might be a good chance that your Engine Light came on for that reason. If you replaced your gas cap and the Engine Light hasn't disappeared, you can try 2 things to clear it:
a. Use the ODB 2 scanner. Comes with a Engine Light reset button.
b. Disconnect your car battery and reconnect (make sure you have your car stereo security code before disconnecting; you'll need this to regain access to your car stereo). After reconnecting, allow your car to run for about 10 minutes or so on idle so the computer can readjust itself to the proper settings.
If you Engine Light reappears, then the missing gas cap was not the complete solution. The error codes may points to other issues that exist.