Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-25 05:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (671 votes), past polls