That might be so, but if you need the file to remain on the server for a while (as part of session management perhaps), then your method breaks.
With some operating systems, for instance OpenBSD, there is a chance that the same PID will occur twice within one second, especially on a heavily loaded site. You are also at risk of exposing your machines current position in the PID list, which could be of use to someone hoping to exploit the way someone has used the PID and time to seed a random number generator.
Use the modules, and you insulate yourself from these problems. CPAN is your friend.