Help for this page

Select Code to Download


  1. or download this
    if (my $pos=$str1 ne $str2) {
      print "A:$str1\nB:$str2\n";
      print "A and B are different at the $pos'th char (index ".($pos-1)."
    +)\n";
    }
    
  2. or download this
    if (my $pos=$str1 gt $str2) {
      $pos+=0;
      print "A:$str1\nB:$str2\n";
      print "The ".(1+$pos)."'th (index $pos) char in A is 'greater' than 
    +that in B\n";
    }