teddyttas,
I have to guess that another script is going to use the zip file you create, since you don't call a subroutine or use the zip file in any way. A couple things can be done:
- Let the other script delete the zip file.
- Delete old zip files when creating new zip files. (see 'stat')
- Call the other script before doing the 'unlink'.
- Use 'sleep' to wait to do the 'unlink'.
- etc. etc. etc.
I think this comes down to "you know what you want to do", but we don't.
Maybe a description of the timing consideration would help give you a better answer.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin