Don't ask to ask, just ask | |
PerlMonks |
Re^9: Modernizing the Postmodern Language?by jcb (Parson) |
on Jul 06, 2020 at 01:03 UTC ( [id://11118948]=note: print w/replies, xml ) | Need Help?? |
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 Section
Meditations
|
|