Text::Balanced to extract subs?
- From: ivowel@xxxxxxxxx
- Date: 15 Jun 2006 19:35:43 -0700
dear perl users: I want to write a function that extracts "ordinary"
subroutines from perl code. (an equivalent task is extracting all
macros from a latex file.) I am not trying to be too clever. let's
presume I can recognize subs because subs and only subs always start at
the first character of a line and are not anonymous. a sub is followed
by a name and can contain nested expressions.
I can do plain pattern matching to find the first occurance of the
first sub: '^sub [a-zA-Z]+'. but now I am stuck. I need to continue
on with a Text::Balanced expression right after, and after the
text::balanced is done, continue on with my regex search (\G).
this must be a very common problem. is Text::Balanced the right module
for the task? if so, can someone please point me to a simple example?
sincerely, /iaw
.
- Follow-Ups:
- Re: Text::Balanced to extract subs?
- From: Ch Lamprecht
- Re: Text::Balanced to extract subs?
- Prev by Date: Re: ANNOUNCE: WWW::YouTube
- Next by Date: Re: Text::Balanced to extract subs?
- Previous by thread: ANNOUNCE: WWW::YouTube
- Next by thread: Re: Text::Balanced to extract subs?
- Index(es):