Re: Need to extract only the function name no brackets reqd.
- From: pangj@xxxxxxxxxxxxx (Jeff Pang)
- Date: Fri, 30 Mar 2007 17:23:17 +0800 (GMT+08:00)
I have this program which extract function names from the files.
My only problem is I want to extract only the function names{no
brackets () needed } .
Currently its extract all words after word sub but it all
returns
the parentheses after that.
Hello,
Given the function definition like below,
sub myfunc($,$){
....
}
You may extract the function name using the regex,
my ($func_name) = $_ =~ /sub\s+(\w+)/;
or even,
my ($func_name) = /sub\s+(\w+)/;
The 'split' is not needed I think.
.
- Follow-Ups:
- RE: Need to extract only the function name no brackets reqd.
- From: Alok Nath
- RE: Need to extract only the function name no brackets reqd.
- Prev by Date: Need to extract only the function name no brackets reqd.
- Next by Date: RE: Need to extract only the function name no brackets reqd.
- Previous by thread: Re: Need to extract only the function name no brackets reqd.
- Next by thread: RE: Need to extract only the function name no brackets reqd.
- Index(es):
Relevant Pages
|