Obviously; you had absolutely no curiosity about how it worked nor why I suggested that it could (in my mind, reliably) help you not run BEGIN blocks.

After wasting company time reading the source code to your ugly little source code filter (not one line of which is documented, commented, or otherwise annotated, by the way!), I found out that I was right all along: it's just a source filter. You can get exactly the same results with an external program, and the results will be more explicit and obvious. Your code doesn't give any insights into how to parse perl at all. It's a red herring, or worse, a wild goose chase.

The hard part is figuring out things like how to pull apart a perl statement with an embedded "do" subexpression.

And now that I consider symbol table tricks, and evals, and s///e, and the stupid @INC trick that makes your source filter work, and all sorts of run-time ugliness, I certainly don't know how to make such a convoluted system behave itself. I'm pretty sure it involves knowning a great deal more than I do about how perl's grammar is laid out; which is work that I frankly don't think an application level developer should have to waste his time on. These are problems that are trivial for the language maintainers with that vast perl grammar memorized, but they're all but impossible for anyone who doesn't.

To solve my immediate problem, I just commented out all the use statements, and a good chunk of the existing code; the syntax check now passes. I have no solution to the larger problem of how to do a correct syntax check for perl. I have no good way to fix the problem; and now you're telling me the perl designers don't care in the slightest. :-(

I don't know any Perl designer who agrees with you, so I say with some confidence that that's never going to happen.

Time to find a language with designers who care about the user's time and productivity, then. :-( I thought that was perl. I guess I thought wrong. :-( I hear Python at least has a BNF grammar... :-(


In reply to Re^10: Syntax checking without BEGIN blocks by Anonymous Monk
in thread Syntax checking without BEGIN blocks by Anonymous Monk

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.