sub open_log_mail { open my $info, ">c_a.txt"; if ($cc ne 0){ print $info "$cc"; } my $a=@filename; my $n=0; for (my $l=0; $l<$a; $l++){ if ($filename[$n] ne 0){ print $info "$filename[$n]\n"; $filename[$n]=0; } $n++; } close $info; open $info, "do("INSERT INTO items_mma(item, businesstype, direction, destination, nature, role, relcode, project, title, subject, keywords, comments, created, creator, changed, changer, signature, size, status) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", undef, ($openvalue, '1', $openvalue, 'MES', $openvalue, '1', $openvalue, '1', $openvalue, $subject, $openvalue, $info, "$Month-$Day-$Year", 'MMA', "$Month-$Day-$Year", '1', '1', '1', '1')) or die ("kan niet toevoegen!"); close $info; }