Re: deprecated idiom to simulate state variables

2017-01-10 Thread Paul Johnson
On Tue, Jan 10, 2017 at 09:04:00AM +0100, Luca Ferrari wrote: > Hi all, > I guess it was in Modern Perl that I saw this deprecated idiom to > simulate state > variables: > > sub foo{ >my $initialized_once = 1 if 0; > ... > } > > Now, why is

deprecated idiom to simulate state variables

2017-01-10 Thread Luca Ferrari
Hi all, I guess it was in Modern Perl that I saw this deprecated idiom to simulate state variables: sub foo{ my $initialized_once = 1 if 0; ... } Now, why is that working and initializing the variable the first time? I mean, each time such row