perl -MTie::Scalar -le' sub make { return sub :lvalue { tie my $tied, "Tie::StdScalar"; return $tied; } } my $f = make(); $f->() = 4; '