#!/usr/local/bin/perl 
use Net::DSML;
use Net::DSML::Filter;
use Net::DSML::Control;
        
# 
# Be sure to set up the first line to point to your perl executable location.
#
# Fill in the server, base, superior and newrdn variables with values that
# match your configuration.
#
# 
# This example does a modrdn of an entry.
# 
my $server = "http://dsml.yourcompany.com:8080/dsml";
my $base = "uid=clif,dc=people,dc=yourcompany,dc=com";
my $superior = "ou=people,dc=yourcompany,dc=com";
my $newrdn = "uid=me"; 
my $webdsml;

   #
   #  We are going to do a entry modrdn now
   #
   $webdsml = Net::DSML->new(  { url => $server,
                                 dn => "abc",
                                 password => "xyz" } );

   if ( !( $webdsml->modrdn( { dn => $base,
                               deleteoldrdn => "true",
                               newsuperior => $superior,
                               newrdn => $newrdn } )))
   {
      print "Modrdn error.", "\n";
      print $webdsml->error, "\n";
      exit;
    }

   if (!($webdsml->send()))
   {
      print "Modrdn send request error.\n";
      print $webdsml->error(),"\n";
      exit;
   }

# get the return xml content, should be the status of the dsml request.
$postData = $webdsml->content();
print $postData, "\n";

