title: perl - how to create an array with n empty strings or zeros?
body: <p>When I manipulate CSV files in Perl I often have a need to initialize an array with some number of same elements:</p>
  
  <pre><code>my $arr = [];
  for my $i (0..$n-1) {
      push @$arr, "";
  }
  </code></pre>
  
  <p>Is there a way to do it in a more compact form?</p>
  
  <p>Perfectly I would like to have an expression for this purpose, so that I can add missing columns easily:</p>
  
  <pre><code>f([@$some_tab, n_elems("", $column_number - scalar(@$some_tab))]);
  </code></pre>
  
  <p>I know how to write a function, but I never do it in 10-line scripts.</p>