$_ =~ s/^&(\w+)([\(\)]*)/$1()/; #### &foobar("asdf") # will only match &foobar( #### s/^(&\w+)\(?((?:(?!;).)*)\)?;/$1($2);/ #### &foobar("a", 5, qw(dave jen anne matt), map({tr/[a-z]/[A-Z]/; $_;} @mixedCase));
## &foobar("asdf") # will only match &foobar( ##
## s/^(&\w+)\(?((?:(?!;).)*)\)?;/$1($2);/ ##
## &foobar("a", 5, qw(dave jen anne matt), map({tr/[a-z]/[A-Z]/; $_;} @mixedCase));