in reply to Knowing when a code string contains code that will be executed at compile-time/end?

G'day perlancar,

"I'm thinking of PPI right now, but that seems too heavy."

[Disclaimer: I've never used either PPI or PPR.]

I was wondering if PPR might be a less-heavy option. A quick reading of "PPR: Comparison with PPI" suggests it might be.

I first heard of PPR in "Keynote by Damian Conway - "Three Little Words" - YouTube". If nothing else, that should provide about a hour of very good entertainment; I thoroughly enjoyed watching it.

— Ken

  • Comment on Re: Knowing when a code string contains code that will be executed at compile-time/end?

Replies are listed 'Best First'.
Re^2: Knowing when a code string contains code that will be executed at compile-time/end?
by haukex (Archbishop) on Aug 15, 2020 at 16:27 UTC

    Although PPR can be used to match Perl code or parts of Perl code (like say if you're trying to implement your own keyword and need a way to express the grammar for it), it is not a real parser, that is, it doesn't really build a syntax tree that can then be inspected. In that respect, PPI is better.