Without a fair bit of rewriting your original code, you can add a last; after the final call to close() -- this will exit the for my $f(@files) loop.
This isn't the way I'd write the script, personally, but I don't know enough about your file structure to revise it accurately. I'd probably use File::Find to make this a bit simpler.
In reply to Re^5: appending to a file
by Nkuvu
in thread appending to a file
by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |