AW: RAD_REQUEST: Calling-Station-Id = ARRAY(0x825a588)

Matt Zagrabelny mzagrabe at d.umn.edu
Thu Jan 8 16:53:15 CET 2015


On Thu, Jan 8, 2015 at 9:41 AM, Herwin Weststrate
<herwin at quarantainenet.nl> wrote:
> On 08-01-15 15:08, Zenz, Thomas wrote:
>
>>          if (scalar(@array) == 1 ){
>>             # everyting OK, one Entry
>>             ;
>>          }
>> ...
>>          elsif (scalar(@array) == 1){
>>             syslog('info', "No Calling-Station-Id");
>>          }
>>
>
> You probably meant "elsif (scalar(@array) == 0) {" in that second block.

Just a point of Perl idioms...

Perl will use the array in scalar context because of the scalar
comparison. No need to force the context:

if (@array == 1) {
}
elsif (@array == 0) {
}

-m


More information about the Freeradius-Users mailing list