A co-worker and I have developed some grammars that are working well. The system that uses them is controlled through a web page that allows users to specify items that are parsed using these grammars. The biggest weakness in the system is that there is currently no editing of the users' entries to be sure they will parse out correctly. I'm trying to develop an edit that takes the user's input, runs the parse and, if the parse fails, captures the error output by Parse::RecDescent and returns it to the user on the web page as a way to help the user correct the problem.
The issue I have is that I am unable to capture the error output. I have tried redirecting both STDOUT and STDERR to a file that I can then parse through to extract the relevant ERROR notices; the output still appears on the screen but does NOT go to my file. I looked in RecDescent.pm and discovered that Damien explicitly opens STDERR and writes out the errors to it. Has anyone successfully solved this or a similar problem? I'm open to any solution (it doesn't have to be redirecting to a file) that will allow me to capture in a program variable the output from Parse::RecDescent. Thanks for the help, Ken