in reply to RE: RE: Re: Subroutine as an lvalue?
in thread Subroutine as an lvalue?

Aha. That's it. The explicit return seems to make the sub return the value of the rhs, but the variable is never modified. That's what "experimental" means.

This works as expected:

#!/usr/bin/perl -wl use strict; { my $count = 0; sub counter : lvalue { ++$count } } print counter() for 1..5; print counter() = -5; print counter() for 1..5;