http://www.perlmonks.org?node_id=176855


in reply to Redirect CGI input?

I think you're looking at this the wrong way. Instead of having your CGI script call your command line program, abstract the logic required to save the data to a seperate module, and create two clients for that module: A command line application and a CGI application.

That way, it doesn't matter how your command line application actually gets the data for testing, just that it passed the data on to the module in the correct form (Say, a hash ref.)