Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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

by Jeffrey Kegler (Hermit)
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?

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://650650]
and cookies bake in the oven...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2018-06-23 22:01 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.