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; }
|
---|
In Section
Seekers of Perl Wisdom