Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Is Text::Balanced production ready?

by Jeffrey Kegler (Friar)
on Nov 14, 2007 at 01:58 UTC ( #650650=note: print w/ replies, xml ) Need Help??


in reply to Re: Is Text::Balanced production ready?
in thread Is Text::Balanced production ready?

What are you trying to do with it ?

I'm designing a parser specification which includes Perl callbacks. There are good examples of this in both Parse::RecDescent and Parse::Yapp. Damian, of course, uses his own Text::Balanced in Parse::RecDescent.

Francois Desarmenien codes his own much simpler approach in Parse::Yapp. Perl callbacks are contained in brackets. The Perl code may contain nested brackets, and escaped ones are ignored in counting the nesting. Francois knows this is far from dealing with every possibility in legal Perl 5, but he leaves the others up to the user to fix. Francois suggests inserting a comment with balancing brackets into the Perl callback as one solution.

So I have examples before me of the same problem being solved by two excellent programmers in different ways.


Comment on Re^2: Is Text::Balanced production ready?
Re^3: Is Text::Balanced production ready?
by renodino (Curate) on Nov 14, 2007 at 16:59 UTC
    Ah, that explains it. Ergo, regexen are not likely to get the job done. In that case, I'd say Text::Balanced is a good bet.

    I suppose I should mention PPI as well, it might make it easier to manipulate the Perl pieces. However, if you're just trying to scan over/capture the Perl pieces, then T::B should be fine.


    Perl Contrarian & SQL fanboy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-08-23 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls