sub sms_senden_g { dat_1(); dat_read(); $empf = 'AT\+CMGS='; $send = '> '; $send1 = '+CMGS:'; $pos_empf = 0; print "Start"; $init = 0; while ($init == 0 && $end == 1) { lesen(); #list aus der COM Schnittstelle falls etwas reinkommt $count = 1 if ($count > 0) { if ($return =~ m/$empf/i) { $pass = $handle->write("\r\n$send"); print "$send\n"; } elsif ($return =~ m/$end_of_sms/i) #falls abschlussnachricht { $pass = $handle->write("\r\n$send1 $count\r\n"); print "$send1 $count\n"; $temp = "$send1 $count\n"; $pass = $handle->write("\r\nOK\r\n"); print "OK\n"; print "Ende"; dat_0(); } else { quitt(); } } else { set_timer(); } } }