I'm not sure what you mean exactly by "done at single string". I guess you mean all in one line. Normally I'd use what you put there,
$method = "something"; $obj->$method($str). It is possible to "embed" the string directly in the call, but it requires not using "strict 'refs'". For that, I'll point you to
Symbolic references.