sub DN () { 'cn=admin,dc=domain,dc=com' } sub PASSWORD () { 'password' } sub SERVER () { 'localhost' } use Carp; use Net::LDAP; # Create connection to the LDAP server and bind authoratively using # administrator credentials my $ldap = Net::LDAP->new( SERVER ); unless ( defined $ldap ) { croak( 'Cannot create connection to LDAP server -- ', $! ); } $ldap->bind ( 'dn' => DN, 'password' => PASSWORD ); my $result = $ldap->add ( 'cn=domain,ou=v_domains,ou=postfix,ou=system_services,dc=domain,dc +=com', 'attr' => [ 'cn' => 'domain', 'objectClass' => 'inetLocalMailRecipient', 'mailLocalAddress' => 'username@domain, domain', 'mailRoutingAddress' => 'alias' ] ); if ( $result->code ) { carp( 'Error in adding LDAP entry -- ', $result->error ); } $ldap->unbind;
Some links which may be of help to you include:
perl -le 'print+unpack"N",pack"B32","00000000000000000000001001110100"'
In reply to Re: Using Perl LDAP
by rob_au
in thread Using Perl LDAP
by hiddenlinux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |