in reply to Substituting method from object
$error_string =~ s/error/$user->get_error_string/e;
This is also how you would replace something with the value returned by a function or any other code.
elusion : http://matt.diephouse.com