title: integrate between range of changelist number in perforce command line
body: <p>perforce intergration between range of changelist</p>
  
  <p>p4-64 integrate -c default $branch1 \@$chglist,\@$chglist $branch2 > changes.txt</p>
  
  <p>Please correct the script If its wrong any where....please guide me</p>
  
  <pre><code>#!/usr/local/bin/perl
  
  #use Mail::Sender;
  
  if ($#ARGV &lt; 2 )
  {
  printf "please enter source branch, target branch and changelistrange(eg: @10001,@100005)\n";
  exit 0;
  }
  
  $branch1=$ARGV[0];
  $branch2=$ARGV[1];
  @branch_name=("$branch1", "$branch2");
  
  $chglistrange=$ARGV[2];
  
  
  print  $P4CLIENT;
  system "(p4-64 info)" ;
  #system "(p4-64 sync $branch1 )";
  #system "(p4-64 sync $branch2 )";
  
  sub verify_branches
  {
    foreach(@branch_name)
    {
      print "You passed in branch $_\n";
             @array=`p4-64 branches -t -e $_`;
             print "@array\n";
    }
  }
  verify_branches
  
  printf "start integration\n";
  system ("p4-64 integ -v $branch1@$chglistrange $branch2 &gt; changes.txt");
  system ("p4-64 resolve -as &gt; files.txt");
  system ("p4-64 resolve -am &gt; acceptmerge.txt");
  system ("p4-64 resolve -n &gt; output.txt");
  if( -z output.txt )
  {
  printf "perforce submit";
  #system ("p4-64 submit");
  }
  else
  {
  printf "perforce submit and sending an mail to developer for resolve conflicts";
  #system ("p4-64 submit");
  printf "write an email to developers\n";
  $sender = new Mail::sender {
  smtp =&gt; 'mail.yourdomain.com', from =&gt; ' '};
  $sender-&gt;MailFile({to =&gt; 'somemail',
  subject =&gt; 'Here are the conflicts in files to be resolved',
  msg =&gt; "I'm sending the list of files which have conflicts.",
  file =&gt; 'output.txt'});
  </code></pre>
  
  <p>here we are trying to integrate using changelist numbers and resolve conflicts and send mail to users if still has conflicts in files.</p>