For one greater than the highest "$name$n.txt" file, something like kcott's solution below works.if (-f "$name.txt") { $n=1; $n++ while -f "$name$n.txt"; }
In reply to Re: Sequentially numbering output files rather than overwriting an existing file
by educated_foo
in thread Sequentially numbering output files rather than overwriting an existing file
by TJCooper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |