sub content{ print $_[0]; return "foobar"; } content( content() =~ s/foo/bar/ ); __END__ Can't modify non-lvalue subroutine call in substitution (s///) at test.pl line 6, near "s/foo/bar/ )"