use strict; use warnings; use Parse::RecDescent; $::RD_ERRORS=1; $::RD_WARN=1; $::RD_HINT=1; $::RD_TRACE=1; open(Parse::RecDescent::ERROR, '>', 'errfile') or die("Can't redirect errors to file 'errfile': $!\n"); open(Parse::RecDescent::TRACE, '>', 'tracefile') or die("Can't redirect errors to file 'tracefile': $!\n"); Parse::RecDescent->new('parse:')->parse('');