Moritz, your reply helped me find the problem. After your suggestion did not work either I rechecked the subroutine and found that I had not passed $coordinates into it. Doing so, now your suggestion and my original line both work. Also, I thought about exist, defined and true and think I should use exist, because it is a prerequisite to defined and true. Thanks a lot for your help! Henri