Hello Christopher -

On Wed, 06 Oct 1999, Christopher Andersson wrote:
> >%_Hello,
> 
> When my PostAuthHook i supposed to run, I get this error message:
> 
> Global symbol "$p" requires explicit package name at (eval 21) line 1, <FILE> chunk 
>62.
> 
> My hook looks like this:
> 
>  sub {   $p = ${$_[1]}; \
>     my $username = $p->getAttrByNum($Radius::Radius::USER_NAME); \
>     print $username; \
>     print "\n"; \
>     }
> 
> What can be wrong? (I dont think perl is that easey)

In your example, $p is assumed to be a global variable. You should use the same
declaration as for "my $username", ie:

# Note - three arguments are passed to PostAuthHook
#                ${$_[0]}   is a pointer to the Request packet
#                ${$_[1]}   is a pointer to the Reply packet
#                ${$_[2]}   is the result of the preceeding authentication
#
# Declare $p as a local variable

sub { my $p = ${$_[0]};\ ...

hth

Hugh

--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody

===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to