Re: global hash variable perl

2011-03-02 Thread Boian Jordanov
On Mar 1, 2011, at 6:05 PM, Vinh Nguyen wrote: Failed binding to authentication address * port 1812: Address already in use /usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812 Thats says everything. You already have an server running. Best Regards, Boian

Re: global hash variable perl

2011-03-01 Thread Alexander Clouter
Hi, * Vinh Nguyen vhn2...@gmail.com [2011-03-01 00:37:17-0600]: something is very strange in my case. I used the global variable like you pointed out. Then I tested the logic and it seems like the hash variable isn't cache properly. The data is not cached. I gave up and tried again in

Re: global hash variable perl

2011-03-01 Thread Vinh Nguyen
here' my debug output. All i wanted to do is to use perl to authorize. perl will then interact with the database. during the requests, i wanted to cache the clients info, instead of writing it to the database since it is short lived. the client will make many authorize requests, and the cached

Re: global hash variable perl

2011-02-28 Thread Dean, Barry
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

Re: global hash variable perl

2011-02-28 Thread Vinh Nguyen
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.d...@liverpool.ac.uk wrote:

Re: global hash variable perl

2011-02-28 Thread Alexander Clouter
Vinh Nguyen vhn2...@gmail.com wrote: I don't think it will make a difference since the perl module is instantiated for every request. Unless I mis-understood something. It is instantiated only once in a mod_perl type of way. If you want more instances, then you need to use threads (since

Re: global hash variable perl

2011-02-28 Thread Vinh Nguyen
I did very similar to your example before but it didn't do it. I perl module name is .pl instead of .pm like yours is it possible you can show me your radius.conf - related to perl section? thanks. On Mon, Feb 28, 2011 at 1:40 PM, Alexander Clouter a...@digriz.org.ukwrote: Vinh Nguyen

Re: global hash variable perl

2011-02-28 Thread Alexander Clouter
Hi, * Vinh Nguyen vhn2...@gmail.com [2011-02-28 15:17:30-0600]: is it possible you can show me your radius.conf - related to perl section? http://lists.freeradius.org/pipermail/freeradius-users/2010-September/msg00529.html Cheers -- Alexander Clouter .sigmonster says: Support Mental

Re: global hash variable perl

2011-02-28 Thread Vinh Nguyen
something is very strange in my case. I used the global variable like you pointed out. Then I tested the logic and it seems like the hash variable isn't cache properly. The data is not cached. I gave up and tried again in couple hours. And then it magically worked. now the hash variable is

global hash variable Perl

2011-02-25 Thread vhn
the # of mysql hits. Thanks. -- View this message in context: http://freeradius.1045715.n5.nabble.com/global-hash-variable-Perl-tp3400771p3400771.html Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list

global hash variable perl

2011-02-25 Thread Vinh Nguyen
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