RE: Need to extract only the function name no brackets reqd.
- From: alok.nath@xxxxxx (Alok Nath)
- Date: Fri, 30 Mar 2007 15:02:28 +0530
Jeff,
It is returning just 1.I think the result of the expression.
-----Original Message-----
From: Jeff Pang [mailto:pangj@xxxxxxxxxxxxx]
Sent: Friday, March 30, 2007 2:53 PM
To: Nath, Alok (STSD); beginners@xxxxxxxx
Subject: Re: Need to extract only the function name no brackets reqd.
I have this program which extract function names from the files.returns
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
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.
.
- References:
- Re: Need to extract only the function name no brackets reqd.
- From: Jeff Pang
- Re: Need to extract only the function name no brackets reqd.
- Prev by Date: Re: 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
|
|