title: Perl memory allocation
body: <p>The following simple C code allocates abouts 1.6% of my computer memory and completes in less than 2 seconds:</p>
  <pre><code>main()
  {
      int i = 0;
      char *array = malloc(64000000);
      for (i = 0; i &lt; 64000000; i++) {
          array[i] = i % 256;
      }
      getchar();
  }
  </code></pre>
  <p>How can I do a similar thing in Perl?</p>
  <p>The following Perl code consumes about 70% of my computer memory (At which I kill it)</p>
  <pre><code>my @array;
  for(my $i=0;$i&lt;64000000;$i++)
  {
      $array[$i]=1;
  }
  getc();
  exit;
  </code></pre>
  <p>How do I malloc in Perl ?</p>