develooper Front page | perl.perl5.porters | Postings from November 2021

Re: A 'permanent' keyword

Thread Previous | Thread Next
Paul "LeoNerd" Evans
November 11, 2021 16:59
Re: A 'permanent' keyword
Message ID:
It's kindof unfortunate that `state` behaves in this manner, as it
isn't actually very useful.

What you describe is exactly what C calls a `static` variable. Because
it isn't lexical, nor is it dynamic. It exists exactly once.

I actually wonder whether the keyword "static" should be used here.

In any case, it's ~trivial to implement that as a CPAN module as a
pluggable keyword. So I'd suggest someone go do that first, and we'll
see how it goes.

Paul "LeoNerd" Evans      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About