You are correct about needing the :lvalue attribute, but if I understand correctly, my will create a new scalar every time FH is called.
Another alternative could be: { my $fh; sub FH :lvalue { $fh } }, using the closure to capture a single instance of the lexical. TIMTOWTDI really works!
In reply to Re^9: Modernizing the Postmodern Language?
by jcb
in thread Modernizing the Postmodern Language?
by WaywardCode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |