Thread Datumsfunktion...: Boa, das is scheisse kompliziert..
(8 answers)
Opened by steinwolf at 2003-08-19 19:32
so in der Art?:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #!/usr/bin/perl my $a = 0; my $sethour = 0; my $setmin = 0; while ($a == 0) { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon=$mon+1; $year=$year+1900; #system(clear); print " Perl Alarm Clock\n"; print " -================-\n"; print " Jetzt ist: Jahr = $year Monat = $mon Tag = $mday Stunde = $hour Minute = $min "; print "Hour to play: "; $sethour = <STDIN>; chomp $sethour; print "Minute to play: "; $setmin = <STDIN>; chomp $setmin; while ($a == 0) { # system(); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon=$mon+1; $year=$year+1900; print "h= $hour m= $min s= $sec D=$mday M=$mon Y=$year $wday $yday $isdst|\n"; print "Wake up time: $sethour:$setmin:00\n"; sleep (10); if ($hour == $sethour && $min == $setmin) #<-Hier kannst Du beliebig erweitern { print "beeb "; #oder welche Aktion auch immer $a++; } } } Steffen\n\n <!--EDIT|Crian|1061397574--> |