in reply to RE: RE: Re: Subroutine as an lvalue?
in thread Subroutine as an lvalue?
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;
|
|---|