title: How can I create a new file using a variable value as the name in Perl?
body: <p>Eg: </p>
  
  <pre><code>$variable = "10000";
  for($i=0; $i&lt;3;$i++)
  {
     $variable++;
     $file = $variable."."."txt";
     open output,'&gt;$file' or die "Can't open the output file!"; 
  }
  </code></pre>
  
  <p>This doesn't work. Please suggest a new way.</p>