in reply to substitution of a string with Square brackets.
s#$methodname\((\Q$2\E)\)#private $methodname($2)#g [download]
should fix it... although I am somewhat suspicious as to what you are doing with $2...