title: How to push data to a multidimensional array?
body: <p>I want to create 10 one dimensional arrays , and put these 10 one dimensional arrays to another one dimensional array , and store some data to some specific index of array .</p>
  
  <p>but the output what I expect should be</p>
  
  <pre><code>expect output         real output
      0                      1
      1                      1
      0                      1
      3                      1
      0                      1
      5                      1
      0                      1
      7                      1
      0                      1
      0                      1
  </code></pre>
  
  <p>here is my code</p>
  
  <pre><code>@Hits = ();
  
  # Create 10 one dimension array
  for($i=0;$i&lt;=9;$i++)
  {
      @Space = ();
      push(@Hits,\@Space);
  }
  
  # Store some data to some index
  push(@{$Hits[1]},1);
  push(@{$Hits[3]},3);
  push(@{$Hits[5]},5);
  push(@{$Hits[7]},7);
  
  # print the first element of 10 arrays
  for($i=0;$i&lt;=9;$i++)
  {
      print $Hits[$i]-&gt;[0];
      print "\n";
  }
  </code></pre>
  
  <p>thanks</p>