Thanks moritz,
i've listened to your suggestions and am trying to correct the issues raised here about the script.
i agree with you on what you say, however i have not used this script on an actually website. i've created this more as an rough example/tutorial for others. however, i realise now that my good intention to help others is a bad example. :-(
thanks again.
ps: i will try to remove this post from "cool use of perl" to "not so cool use of perl" :-)