title: Printing a 2500 x 2500 dimensional matrix using Perl
body: <p>I am very new to Perl. Recently I wrote a code to calculate the coefficient of correlation between the atoms between two structures. This is a brief summary of my program.</p>
  
  <pre><code>for($i=1;$i&lt;=2500;$i++)
  {
      for($j=1;$j&lt;=2500;$j++)
      {
           calculate the correlation (Cij);
           print $Cij;
      }
  }
  </code></pre>
  
  <p>This program prints all the correlations serially in a single column. But I need to print the correlations in the form of a matrix, something like..</p>
  
  <pre><code>         Atom1    Atom2   Atom3    Atom4
  Atom1     0.5     -0.1     0.6      0.8
  Atom2     0.1      0.2     0.3     -0.5
  Atom3    -0.8      0.9     1.0      0.0
  Atom4     0.3      1.0     0.8     -0.8
  </code></pre>
  
  <p>I don't know, how it can be done. Please help me with a solution or suggest me how to do it !</p>