global hash variable perl

Dean, Barry B.Dean at liverpool.ac.uk
Mon Feb 28 10:49:51 CET 2011


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


[cid:4EC9B0A7-FE12-4AEE-A412-E3909697565C at liv.ac.uk]

---
Nice boy, but about as sharp as a sack of wet mice.
               -- Foghorn Leghorn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110228/89ecf8b3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h1_a.png
Type: image/png
Size: 3693 bytes
Desc: h1_a.png
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110228/89ecf8b3/attachment.png>


More information about the Freeradius-Users mailing list