From: Chris R. <chr...@me...> - 2002-06-13 16:37:09
|
Graham Barr <gb...@po...> wrote: > On Thu, Jun 13, 2002 at 05:01:33PM +0100, Chris Ridd wrote: >> > 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? > > Optional parameters. But if someone wants to provide a patch to make > things more clear ..... > > Graham. > Right, but as Andrew points out that doesn't work. The code: $entry->delete('foo', 'bar'); fails, despite the documentation ;-) I'm not sure what people really want to do with this method (as I mentioned I've not really used it before) so this may really be a documentation bug. How about this instead: delete ( ATTR [ => VALUE [, ATTR2 => VALUE2 ... ] ) Delete one or more attributes from the entry. Each value must either be a scalar variable or a reference to an array (an empty array means delete all the values). As a special case to delete a single attribute completely, just pass the name of the attribute. The following two examples are equivalent: $entry->delete( 'mail' ); $entry->delete( 'mail' => [ ] ); Cheers, Chris |