http://qs1969.pair.com?node_id=292588

jai has asked for the wisdom of the Perl Monks concerning the following question:

hi,
I have to write a perl program that lists out all the functions in a given C source file & prints the functions called by each of them. To match the called functions, I first had the regex
(/([a-zA-Z][a-zA-Z0-9_-]*)\s*\([^)]*\)/)
.But this failed to match the following:
if((err=func1(a,b))!=0).
So I modified it to
(/([a-zA-Z][a-zA-Z0-9_-]*)\s*\([^)(]*\)/).
Still, it fails for functions called like this.
if((err=func1(a,b,(*c)()).
Is there any way to reliably parse them ? any help would be greatly appreciated.
jai