|
|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : Andrew Alakozow 2:5061/6 15 Apr 2003 11:06:41 To : Sergey Larionov Subject : Re: alarm --------------------------------------------------------------------------------
SL> Hеобходимо, через определенные промежутки времени, вызывать некоторую
SL> функцию.
perldoc -f sleep
Если функцию нужно вызывать одновременно с другими действиями, то еще
perldoc -f fork.
use strict;
$|++;
if (my $pid = fork) {
print("this is the begining of the beautiful friendship\n");
sleep(5);
print("this is the beautiful friendship\n");
sleep(5);
print("this is the end of the beautiful friendship\n");
} elsif (defined $pid) {
foreach (qw(one two three four)) {sleep(2); print("$_...\n") };
} else { die "can't fork!\n"; }
aa29
--- Microsoft Outlook Express 6.00.2720.3000
* Origin: Life In The Dark (2:5061/6)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/43900c33cd8e7.html, оценка из 5, голосов 10
|