Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by kcott (Archbishop)
on Aug 15, 2020 at 11:44 UTC ( [id://11120778]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found