Shared data between in perl module

Юрий Иванов format_hub at
Fri May 21 08:58:37 CEST 2021

Thanks for replies,
threads::shared; looks simple to use. I've already done some testing but looks like threaded perl is slower.
Does not understand what performance of the singleton pattern maybe I've need some debugs.
Btw, looks like IPC pipes can do the same thing with very fast too.

От: Freeradius-Users < at> от имени Jorge Pereira <jpereira at>
Отправлено: 19 мая 2021 г. 4:44
Кому: FreeRadius users mailing list <freeradius-users at>
Тема: Re: Shared data between in perl module

Or maybe use the _Singleton Pattern_ <>
Jorge Pereira
jpereira at

> On 18 May 2021, at 11:21, Alan DeKok <aland at> wrote:
> On May 18, 2021, at 7:52 AM, Юрий Иванов <format_hub at> wrote:
>> I plan to implement accounting logic with the help of perl module.
>> Looks simple, but every time I should open new database connection which is not very effective in case of high load systems.
>> sub accounting {
>>   $redis = Redis->new(server => '', reconnect => 2);
>>   ...
>> Is there way to make some sort of "shared" variable in perl module?
>  This is part of Perl:
>> P.S. Maybe there is even some way to create some buffer array variable inside perl module which persists between perl modules so I can drop redis?
>  Use the threads::shared package, and put the buffer array into a shared variable.
>  Alan DeKok.
> -
> List info/subscribe/unsubscribe? See

List info/subscribe/unsubscribe? See

More information about the Freeradius-Users mailing list