Balanced Text??

M

MPBroida

Hi!
I've seen this mentioned here before, but I can't find
the specific messages. It's not directly in the FAQ,
either, though it's a "standard" response to questions
about nested parens/etc when asked in this newsgroup.

But I don't recall whether the package/module is:
Text::Balanced
or:
Balanced::Text

Neither is installed here, so I need the CORRECT name
so I can request that it be acquired and installed.

Thanks!
Mike
 
A

Andreas Kahari

MPBroida wrote: said:
But I don't recall whether the package/module is:
Text::Balanced
or:
Balanced::Text

Use search.cpan.org and search for "Balanced".
 
M

MPBroida

MPBroida said:
Hi!
I've seen this mentioned here before, but I can't find
the specific messages. It's not directly in the FAQ,
either, though it's a "standard" response to questions
about nested parens/etc when asked in this newsgroup.

But I don't recall whether the package/module is:
Text::Balanced
or:
Balanced::Text

Neither is installed here, so I need the CORRECT name
so I can request that it be acquired and installed.

Thanks!
Mike

Thanks, all, for the responses!
Mike
 
T

Tad McClellan

MPBroida said:
I've seen this mentioned here before, but I can't find
the specific messages. It's not directly in the FAQ,
either,


Yes it is.

But I don't recall whether the package/module is:
Text::Balanced
or:
Balanced::Text


perldoc -q Balanced

Can I use Perl regular expressions to match balanced text?
 
M

MPBroida

Tad said:
Yes it is.

Don't see it anywhere.

perldoc -q Balanced

Can I use Perl regular expressions to match balanced text?

But that perldoc section does NOT refer to either
"Balanced::Text" or "Text::Balanced", and that's
what I was hunting for: the real name of that module/
package/whatever it is.

Mike
 
T

Tad McClellan

MPBroida said:
Don't see it anywhere.



But that perldoc section does NOT refer to either
"Balanced::Text" or "Text::Balanced", and that's
what I was hunting for: the real name of that module/
package/whatever it is.


Huh?

Can I use Perl regular expressions to match balanced text?

Historically, Perl regular expressions were not
capable of matching balanced text. As of more
recent versions of perl including 5.6.1 experimen­
tal features have been added that make it possible
to do this. Look at the documentation for the
(??{ }) construct in recent perlre manual pages to
see an example of matching balanced parentheses.
Be sure to take special notice of the warnings
present in the manual before making use of this
feature.

CPAN contains many modules that can be useful for
matching text depending on the context. Damian
Conway provides some useful patterns in Reg­
exp::Common. The module Text::Balanced provides a
^^^^^^^^^^^^^^
general solution to this problem.
 
M

MPBroida

Tad said:
Huh?

Can I use Perl regular expressions to match balanced text?

Historically, Perl regular expressions were not
capable of matching balanced text. As of more
recent versions of perl including 5.6.1 experimen­
tal features have been added that make it possible
to do this. Look at the documentation for the
(??{ }) construct in recent perlre manual pages to
see an example of matching balanced parentheses.
Be sure to take special notice of the warnings
present in the manual before making use of this
feature.

CPAN contains many modules that can be useful for
matching text depending on the context. Damian
Conway provides some useful patterns in Reg­
exp::Common. The module Text::Balanced provides a
^^^^^^^^^^^^^^
general solution to this problem.

Hmm, must be a different Perl version. I get quite a bit
less info, and NO mention of the specific Text::Balanced
package.

I'm using 5.6.0, "binary build 616 provided by ActiveState <etc>".
I've noticed that the perldoc contents are a bit newer and more
complete than the 2nd Edition Camel book, but it's probably a
bit less complete than the version you're using. Unfortunately,
there's little chance of updating the version here: too many
tools depend on it working EXACTLY as it does now. "Someday"
we'll update.

Thanks for the updated info. :)

Mike
 
M

Malcolm Dew-Jones

MPBroida (michael.p.broida@boeing_oops.com) wrote:

: > exp::Common. The module Text::Balanced provides a
: > ^^^^^^^^^^^^^^
: > general solution to this problem.

: Unfortunately,
: there's little chance of updating the version here: too many
: tools depend on it working EXACTLY as it does now. "Someday"
: we'll update.

: Thanks for the updated info. :)


Text::Balanced says it requires perl 5.005

(Which is much less than 5.6.anything)

so I don't understand why you don't just install the module and use it.
 
M

MPBroida

Malcolm said:
MPBroida (michael.p.broida@boeing_oops.com) wrote:

: > exp::Common. The module Text::Balanced provides a
: > ^^^^^^^^^^^^^^
: > general solution to this problem.

: Unfortunately,
: there's little chance of updating the version here: too many
: tools depend on it working EXACTLY as it does now. "Someday"
: we'll update.

: Thanks for the updated info. :)

Text::Balanced says it requires perl 5.005

(Which is much less than 5.6.anything)

so I don't understand why you don't just install the module and use it.

I will do that, now that I have been informed of the ACTUAL name
of the module. This whole thread started with my question:
Is it named "Text::Balanced" or "Balanced::Text"?
Rather hard to FIND, much less install, a module you don't
know the name of. :/

The perldoc for our version of Perl does NOT contain the same
text that Mr. McClellan quoted from, so his latest response was
the first one to give me the info I requested.

I wasn't bemoaning not being able to install that module; as you
pointed out, it's quite possible to do. I was just pointing out
that our installation, being older, doesn't have the latest docs
with it, so I didn't have the info Mr. McClellan quoted, and there
are certainly other bits of info not on this installation as well.

Mike
 
D

David K. Wall

MPBroida said:
Malcolm Dew-Jones wrote: ....

I will do that, now that I have been informed of the ACTUAL
name of the module. This whole thread started with my
question:
Is it named "Text::Balanced" or "Balanced::Text"?
Rather hard to FIND, much less install, a module you don't
know the name of. :/

http://search.cpan.org/ is a useful tool....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top