I am having the wierdest problem.
I am writing a Parse::RecDescent parser. No big deal, I'm a language junkie and I write them all the time. But, this is the first time I am writing one under Windows using ActiveState Perl (latest version as of last week).
Here's the wierd part. Any errors in the grammar compilation or the parse are not reported properly. All I get for each error is the ':' char. At the place it would normally be in the error.
If I turn on trace, I get the structure of the trace, but not the data. I.e. I get all the '|' but everything else is blank. For example:
1| | | 2| | | 2| | |

The numbers on the left meander up and down, implying that the traces is running properly.
I tried the FAQ trick of redirecting the error output to a file, and the file contains the same erroneous results as the screen.
I am totally stumped, anyone seen this behavior? here's my code that sets up the parse:
use strict; use warnings; use Data::Dumper; use Parse::RecDescent; use File::Slurp; open (Parse::RecDescent::ERROR, ">errfile") or die "Can't redirect errors to file 'errfile'"; $::RD_ERRORS=1; $::RD_WARN=1; $::RD_HINT=1; $::RD_TRACE=$ARGV[0]; sub main { my $grammar=read_file("etc/parser.rd"); my $parser = new Parse::RecDescent($grammar); my $data = read_file("data/spec.spd"); $parser->program($data); } main();


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

In reply to Wierd Windows Parse::RecDescent output problem by dreadpiratepeter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.