Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Is Text::Balanced production ready?

by renodino (Curate)
on Nov 13, 2007 at 16:47 UTC ( #650536=note: print w/ replies, xml ) Need Help??


in reply to Is Text::Balanced production ready?

What are you trying to do with it ? I've used it for a source filter (SQL::Preproc) with only one issue I needed to work around (heredocs, which I believe has since been fixed). That said, unless you're parsing Perl code, I'd suggest trying to exersize your regex muscles first.


Perl Contrarian & SQL fanboy


Comment on Re: Is Text::Balanced production ready?
Re^2: Is Text::Balanced production ready?
by Jeffrey Kegler (Friar) on Nov 14, 2007 at 01:58 UTC
    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.

      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://650536]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-09-21 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (173 votes), past polls