in reply to substitution of a string with Square brackets.
Hi, Try like this,
Untested
$line =~ s#$methodname\((\Q$2\E)\)#private $methodname($2)#g [download]
Regards,Velusamy R.