in reply to Re^11: Making a variable in a sub retain its value between calls
in thread Making a variable in a sub retain its value between calls
On the other hand, going back to the OP's question, INIT is not the Perl 6 solution to that. Instead, we'll use state variables, which have FIRST semantics rather than INIT semantics. That lets closure clones get individual state variables with individual initializations, but makes Perl keep track of "first use" for the user. INIT is just too blunt of an ax for that purpose.
|
---|