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

Re: A 'permanent' keyword

Thread Previous | Thread Next
From:
demerphq
Date:
November 12, 2021 09:35
Subject:
Re: A 'permanent' keyword
Message ID:
CANgJU+U=Rr8J2MvACCTs5H6WCAvJg1Y84+bZAykMqusgK_8TWw@mail.gmail.com
On Fri, 12 Nov 2021 at 04:19, Leon Timmermans <fawaka@gmail.com> wrote:

>
> Ultimately, state is equivalent to "a my variable outside the current sub"
> and permanent is equivalent to "a my outside the outermost sub" (or a state
> inside the outermost sub). They're both useful concepts, but they can also
> both already be expressed in the traditional ways.
>

I think the first quoted part in your first sentence would be a super
helpful addition to the docs. Personally I can't stand state variables as I
am never 100% sure how they behave compared to simple my declarations where
the rules are simple enough I can be confident I remember them.

Anyway, better docs on state would be nice.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About