WOW, now it's getting narrowed down. audiopro, your second test worked and created the file!
#define and create textfile for replies
$id='test';
my $checkid = $id.".txt";
So something is wrong with my $id variable. I am chomping it, the length is correct, I don't get it... Is it possible...