From: Jim H. <ha...@us...> - 2000-06-05 18:06:41
|
There are a variety of ways of doing this. My preference is @base_attributes = ( objectclass => 'minimalRadiusPerson', ServiceType => '2', FramedProtocol => 'PPP', FramedMTU => '1500', AscendIdleLimit => '900' ); $ldap_res = $mast_srv->add ($dn, attrs => \@base_attributes ); That is, using an array for the attribute list, then using a reference to that array for "attrs". Don't forget the \ before the reference. --Jim Harle US Naval Academy On Mon, 5 Jun 2000, Eric S. Johansson wrote: > this is probably more of the perl problem than anything else but I'm trying > to figure out how to pass a dynamic list of attributes to LDAP add. The > base attribute list looks exactly like: > > $base_attributes = { > objectclass => 'minimalRadiusPerson', > ServiceType => '2', > FramedProtocol => 'PPP', > FramedMTU => '1500', > AscendIdleLimit => '900' > }; > > as the data source specifies additional attributes, I add them to the hash. > Passing them on the other hand has been a bit of a problem. I'm missing > something about perl references which will let me pass this reference to an > anonymous hash in as an attrs argument. I've tried different forms but I'm > not getting the right level of dereferencing. What I missing? > ... > $ldap_res = $mast_srv->add ($dn, > attrs => $base_attributes > ); > die "unable to add entry $dn " if ($ldap_res->code); > > > > > > |