8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
sub start {
# check-Variable auf 1 (on) stellen..
open (ONOFF,">OnOff.num") || die ("Can't open OnOff.num!");
flock(ONOFF, 2) or &cgierr("unable to get exclusive lock on OnOff.num.\nReason: $!");
print ONOFF "1";
close ONOFF;
#&endlessLoop(); # geht so nicht weil auf return-value wartet..
# hier wartet er auch! -> warum?
{ exec (&endlessLoop()) }; print STDERR "couldn't exec &endlessLoop(): $!";
&mainControlFrame(); # zurück zum HauptFrame..
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use WIN32::Process;
use WIN32;
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Win32::Process::Create($ProcessObj,
"C:\\Perl\\bin\\perl.exe",
'perl endless.pl',
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
1
2
3
4
5
6
7
8
$pid = fork;
die "Can't fork: $!" if !defined $pid;
if ($pid == 0) { # child
exec $^X, "endless.pl";
die "Exec failed: $!";
}
# parent
...
1
2
3
4
5
6
7
8
$pid = fork;
die "Can't fork: $!" if !defined $pid;
if ($pid == 0) { # child
exec $^X, "endless.pl";
die "Exec failed: $!";
}
# parent
...
8 Einträge, 1 Seite |