[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] COBOL as Perl



Chaim, could you clarify a couple of things in this code?  There are a
few lines I'm suspicious of.

On Fri, Jul 02, 1999 at 11:20:29AM -0400, Chaim Frenkel wrote:
> 	$high_value = "\xff" x 80;	# Or whatever
> 	
> 	$left = <LEFT>;
> 	$left_key = extract_key($left);
> 
> 	$right = <LEFT>;
                  ^^^^ Should this be <RIGHT>?

> 	$right_key  = extract_key($right);
> 
> 	while (1) {
> 		$key = extract_key();	# Do whatever is needed
> 
> 		if ($left_key lt $right_key) {
> 			# use left
> 
> 			$left = <LEFT>;
> 			$left_key = extract_key($left);
> 			next;
> 		}
> 
> 		if ($left_key gt $right_key) {
> 			# use right
> 
> 			$right = <RIGHT>;
> 			$right_key = extract_key($right);
> 			next;
> 		}
> 
> 		if ($left_key eq $high_values) {
> 			last;	# Finished.
> 		}
> 
> 		# use both
> 
> 		$right = <LEFT>;
                          ^^^^ Should this be <RIGHT>?

> 		$right_key = extract_key($right);
> 		$left = <LEFT>;
> 		$left_key = extract_key($right);
                                         ^^^^^ Should this be $left?

> 	}

==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org