> 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. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/