svc_acct.export code functionality explanation?

dk smith dks at spies.com
Thu Jul 8 12:22:04 PDT 1999


In svc_acct.export,v 1.2, in the Radius Users file export section, I am not
clear what the map function is doing. Can anyone describe what this does?
That is, the join statement...

And what is the significance of the "0e0"?

thx,
dk


    ###
    # FORMAT OF THE USERS FILE HERE
    print USERS
      $svc_acct->username, qq(\tPassword = "$rpassword"\n\t),

      join ",\n\t",
        map  {
          /^(radius_(.*))$/;
          my($field,$attrib)=($1,$2);
          $attrib =~ s/_/\-/g;
          "$attrib = \"". $svc_acct->getfield($field). "\"";
        } grep /^radius_/ && $svc_acct->getfield($_), fields('svc_acct')
    ;
    if ( $ip && $ip ne '0e0' ) {
      print USERS qq(,\n\tFramed-Address = "$ip"\n\n);
    } else {
      print USERS qq(\n\n);
    }

--
dks at spies.com   |   Perception is nine tenths of the law.






More information about the freeside-users mailing list