Accidentally sent before I was done writing.

I am trying to iterate through two hashes and print each key/value. In one
column the key/value from one hash and another column the key/values of the
other hash. So the output would look something like this

Some header       |        header for column 2
Key value                     key value
Key value                     key value
Key value                     key value
Key value                     key value
Key value                     key value
Key value                     key value
Key value
Key value

Etc...

Here's what I am doing right now

($a, $b, $c) = 0;
  foreach (sort keys (%TARGET)){
    @TEMP[$a] = "$_ $TARGET{$_}";
    $a++;
  }
  foreach (sort keys (%PROD)){
    @TEMP2[$b] = "$_ $PROD{$_}";
    $b++;
  }
  print OUT "\@ prod not present.    |    Present not at prod.\n"; 
  if ($a > $b){
    for ($n=0 , $n = $a, $n++){
      printf OUT "%15s             %15s\n", (@TEMP[$n], @TEMP2[$n]);
    }
  } else {
    for ($n=0 , $n = $b, $n++){
      printf OUT "%15s             %15s\n", (@TEMP[$n], @TEMP2[$n]);
    }
  }

Reply via email to