[RADIATOR] Best way to use perl use statement in handler

Hugh Irvine hugh at open.com.au
Fri Jun 26 04:18:37 CDT 2009


Hello Michael -

The code is only compiled once.

You should check the "Camel" book for details.

regards

Hugh


On 25 Jun 2009, at 23:12, Michael Harlow wrote:

>
> Hi,
>
> I've just made an enhancement to a perl hook (based on the  
> eap_anon_hook.pl) where I want to send a message to a remote web  
> server each time an accounting "Start" is received, to activate an  
> Internet Management System. It is working fine.
>
> However my question (with my very thin Perl knowledge) is about the  
> "use" statements, and their presence inside the "sub". Is this the  
> best place to have them, and does that result in the perl  
> interpreter constantly fetching and loading those perl modules for  
> each packet, or does it have negligible impact on perl this way. If  
> it is impacting performance, how should they be placed/defined to  
> minimise the performance hit?
>
> Thanks, Michael
>
>
> sub
> {
>
>   # IMS Requirements
>   use LWP::UserAgent;
>   my $ua = LWP::UserAgent->new;
>   use HTTP::Request::Common qw(POST);
>   #
>
>   # original eap_anon handler code start
>   use DBI;
>   my ($p, $rp, $handled, $reason) = @_;
>    .....
>    .....
>
>
>
> }
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator



NB:

Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
Have you checked the RadiusExpert wiki:
http://www.open.com.au/wiki/index.php/Main_Page

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.




More information about the radiator mailing list