develooper Front page | perl.beginners | Postings from October 2022

Re: How to implement a static method in perl class?

Thread Previous
From:
Andrew Solomon
Date:
October 14, 2022 09:57
Subject:
Re: How to implement a static method in perl class?
Message ID:
CAN=twKvE8nT9ejXRC_GGgpBv-AErCGzhoytDtume1_MkDGHRbQ@mail.gmail.com
That's correct.

On Fri, Oct 14, 2022 at 1:31 AM Henrik P <henrik@simplemail.co.in> wrote:

> so this is not a singleton, but a stateful variable sharing status among
> all the instances, is it?
>
> thanks for your code sharing.
>
>
> Andrew Solomon wrote:
> > Now, the fact that this has been called in a package with a 'new' method
> > makes me wonder whether you'd actually like "count" to be a method of an
> > object. As you can see, using the state variable within the package it
> > is still shared with all objects of that class.
> >
> > https://publ.ink/x/e69403568d37b18476872443f9f7afa9
> > <https://publ.ink/x/e69403568d37b18476872443f9f7afa9>
>
> --
> Simple Mail
> https://simplemail.co.in/
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>

Thread Previous


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