I'm pretty sure that e.g. this line:
Code:

$logfile=@SCRIPTDIR+"\dis_user_log.txt"$nul=open(1,$logfile,5)


is incorrect. You might also want to post properly indented code.
_________________________
There are two types of vessels, submarines and targets.