If you just want to make sure the file goes away when you've finished
with it, you can use the File::Temp module. Otherwise, please give more
details on what you are trying to accomplish; unless
system qq{sleep 5 && rm -f "$file" &};
does what you want. In general you will need to have a process hanging
around to remove the file for you.
Ben
I was having a hard time figuring out how to explain it, and realized
that what I need to do has to be done in the software, ie creating the
temporary file (a jpg image) and then deleting that one and creating a
new one (with a new name) when things change, while keeping track of
what file is "current" in a different file (in this case an XML). I
was hoping to have some way of having the old, replaced, unused files
(with obsolete filenames) "go away" on their own but I suppose a file
system hasn't progressed to the point of being able to use it like
memory where you "allocate" a block of memory and when done using it
you can "unallocate" it and it "goes away".
Bill H