in reply to Unix rename behaviour

The behaviour depends upon when the filehandle is closed. Here's my test :
$ echo "hello" > toto $ cat toto hello $ perl -e 'open F, "<toto"; sleep 30; print <F>'
At the same time I launch in another terminal:
$ perl -e 'open F, ">toto"; print F 'goodbye'; close F; sleep 30'
The output in the first shell is "goodbye". If I change the second one liner to rename the file :
perl -e 'open F, ">toto"; system ("mv toto tata"); print F 'goodbye'; +close F; sleep 30'
The output remains goodbye. However, if I change the second one-liner to:
perl -e 'open F, ">toto"; system ("mv toto tata"); print F 'goodbye'; +sleep 30'
So to close the file last, then the first oneliner reads nothing at all.