http://qs321.pair.com?node_id=1069844


in reply to Re: Sequentially numbering output files rather than overwriting an existing file
in thread Sequentially numbering output files rather than overwriting an existing file

For more visually pleasing output:
if (-f "$name.txt") { $n=1; my $fn = sprintf "%s-%05d\.txt", $name, $n; $n++ while -f $fn; }
  • Comment on Re^2: Sequentially numbering output files rather than overwriting an existing file
  • Download Code