in reply to substitution of a string with Square brackets.
$line =~ s#$methodname\((\Q$2\E)\)#private $methodname(\Q$2\E)#g [download]