#!/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, attribute and value variables with values that
# match your configuration.
#
# 
# This examples shows how to compare a value to an attribute.
# 
my $server = "http://dsml.yourcompany.com:8080/dsml";
my $base = "cn=Burning Man,ou=people,dc=yourcompany,dc=com";
my $attribute = "givenName";
my $value = "Jay"; 
my $webdsml;

   #
   #  We are going to do a data compare now
   #
   $webdsml = Net::DSML->new(  { url => $server } );

   if ( !( $webdsml->compare( { dn => $base, 
                                attribute => $attribute,
                                value => $value } ) ) )
   {
      print "Compare error.", "\n";
      print $webdsml->error, "\n";
      exit;
    }

   if (!($webdsml->send()))
   {
      print "Compare 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";

