in reply to Re^5: Read in hostfile, modify, output
in thread Read in hostfile, modify, output

Under Windows, this cannot happen. The rename will fail if the target file exists.

What? Works for me (it's just not atomic, as far as I can tell).

echo foo >foo echo bar >bar perl -e "rename(foo,bar)"