From: Alan T. DeKok Date: Mon, 28 Feb 2011 10:00:14 +0000 (+0100) Subject: Added sample of using global / static variables X-Git-Tag: release_2_1_11~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa45e9eb8e4181dbc763172cae2184e095da29e2;p=thirdparty%2Ffreeradius-server.git Added sample of using global / static variables --- diff --git a/src/modules/rlm_perl/example.pl b/src/modules/rlm_perl/example.pl index 7395ece6657..1dd9fb8206d 100644 --- a/src/modules/rlm_perl/example.pl +++ b/src/modules/rlm_perl/example.pl @@ -53,6 +53,19 @@ use Data::Dumper; use constant RLM_MODULE_UPDATED=> 8;# /* OK (pairs modified) */ use constant RLM_MODULE_NUMCODES=> 9;# /* How many return codes there are */ +# Global variables can persist across different calls to the module. +# +# +# { +# my %static_global_hash = (); +# +# sub post_auth { +# ... +# } +# ... +# } + + # Function to handle authorize sub authorize { # For debugging purposes only