in reply to Matching parens on a regex is beating me

Found an example of an regexp to do this in perldoc perlre, and implemented it. should work.
#!perl -l use strict; my @a=("func2(func1(input1, input2), input3)", "func1(input1, func2(in +put2, input3))"); my $re = ""; $re=qr{\((((?>[^()]+)|(??{ $re }))*)\)}; for my $line (@a) { $line =~ s/func1$re/proc1{$1}/g; $line =~ s/func2$re/FUNC $1 END/g; $line =~ tr/{}/()/; print $line; }
Terje