I want to make a script that will read a file* which only contains a number. I then want to increment the number by 1, ie the number plus 1. Then I want it to delete the existing number and write the new number to the file.
* It must check if the file exists first, and if not, create one and write the number '1' to it.
Can anyone help with this, please? My knowledge of perl is extremely basic.