global hash variable perl

Vinh Nguyen vhn2000 at gmail.com
Mon Feb 28 18:13:05 CET 2011


I don't think it will make a difference since the perl module is
instantiated for every request. Unless I mis-understood something.

Earlier I tried similar to what you suggested - without the {}. but it
didn't work.

On Mon, Feb 28, 2011 at 3:49 AM, Dean, Barry <B.Dean at liverpool.ac.uk> wrote:

> Yes. Do something like this:
>
> {
> my %static_global_hash = ();
>
> sub post_auth {
> ...
> }
> ...
> }
>
> static_global_hash will then be available on each call to the subs so you
> can store some kind of state between requests that you handle.
>
> The trick is placing the whole lot into a {} block. Perl can be odd at
> times...
>
>   On 25 Feb 2011, at 20:25, Vinh Nguyen wrote:
>
>   hi all,
>
> I was able to setup my freeradius to use perl and mysql. Things are working
> ok. I wanted to use a global hash variable to store information. This way
> all other requests can also access this hash variable. Is this doable? I
> know you can use mysql for this purpose, but i wanted to reduce the # of
> mysql hits.
>
> Thanks.
>
> --
> Computer Science B.S. at Texas A&M
> C# .Net Developer
> Server Analyst.
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
>
>     ----------------------
> Barry Dean
> Principal Programmer/Analyst
> Networks Group
> Computing Services Department
>
>
>
> ---
> Nice boy, but about as sharp as a sack of wet mice.
>                -- Foghorn Leghorn
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>



-- 
Computer Science B.S. at Texas A&M
C# .Net Developer
Server Analyst.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110228/e0342d25/attachment.html>


More information about the Freeradius-Users mailing list