use Text::Balanced qw(extract_codeblock); # get source code in this variable my $source = ....; # regexp finds where method is defined and sets "pos" (see perldoc -f +pos), # than extract_codeblock extracts following codeblock if($source =~ /public \s+ void \s+ readExternal \s+ \( .*? \) \s+ /gx) + { my $sub_source = extract_codeblock($source); print $sub_source; }
--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
In reply to Re: Extract lines of .java
by IlyaM
in thread Extract lines of .java
by knobbled
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |