From: Chris R. <chr...@me...> - 2002-06-13 16:00:14
|
Andrew Tristan <atr...@ac...> wrote: > Whoops, transcription error on my part. I tried a bunch of different > things; when I typed that message, I mistakenly combined several > different things. I should have just cut/pasted my actual code rather > than typing it out. > > One of the things I'm trying to do is to remove openLDAP's time stamp > attributes. The first thing I did was, > > $ldifEntry->delete('creatorsname','modifiersname', > 'createtimestamp','modifytimestamp'); Well you aren't allowed to do that on a server anyway, since those attributes are classed as not user modifiable. (This is irrespective of access controls.) It'll work using an LDIF file of course. > which results in, > > Can't use string ("modifiersname") as an ARRAY ref while "strict refs" > in use at /inst/pkg-ver/perl-5.6.1/lib/site_perl/Net/LDAP/Entry.pm line > 179, <GEN0> line 2. > > Am I missing a typo there somewhere? The next thing I thought was, "oh > yeah, I should be passing a reference to that list"; this is what the > perl-ldap docs suggest (the documentation for the delete method says > 'delete ( [ ATTR [, ATTR2 ... ]] )'), is that incorrect, or am I > misunderstanding something? So I tried passing a reference to that > anonymous array, like so, Yes, that's confusing. Do the outer square brackets indicate optional parameters, or literally square brackets? > $ldifEntry->delete(['creatorsname',...]); > > this runs without error, but also doesn't remove those attributes. The guts of the delete method is a loop that takes pairs of things from the argument list, a type and a value. So try this: $ldifEntry->delete('creatorsname' => [], 'createtimestamp' => []); That seems to work for me. I've never really used Net::LDAP::Entry objects like this myself, so there may be a much better way to do it. Cheers, Chris |