My script does use cgi but when it is run from the command line it returns different results than if run from a browser. Is there a way to trick a script to think that is was run from a browser? How does Apache or other web servers open the script and get results? What do they do different? Aren't they reading from STDOUT also? Isn't there a way to simulate a web server to get the 'web' results of a single script?