I really don't understand your statement about needing to run 20 copies of the script because of a race condition, but if you want to save memory you should try starting up one script and forking rather than starting 20 different copies of Perl. The copy-on-write nature of memory handling in modern OSes will save you quite a bit of RAM.