#!/usr/local/bin/perl 
use Net::DSML;
use Net::DSML::Filter;
use Net::DSML::Control;

# 
# 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 => "cn", 
                                value => "Super Man" } ) ) )
   {
      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";

