Thread Perl-Skript und Scheduled Tasks: Perl-Skript läuft nicht los... (18 answers)
Opened by Ozymades at 2007-04-10 14:25

Ozymades
 2007-04-10 15:32
#75782 #75782
User since
2007-04-10
8 Artikel
BenutzerIn
[default_avatar]
Hmm, ok. Also hier mal ein komplettes Beispiel:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl -w
use strict;
use subs qw/print_log/;

my $var = "Hallo Welt!\n";
print_log $var;

sub print_log
{
my $string = shift;
my $logfile = "c:\\temp\\test.log";
$! = 0;
unless(open(LOG, ">>", $logfile))
{
print "Konnte Logfile nicht oeffnen: $!";
exit 1;
}
print $string;
print LOG $string;
close(LOG);
}


Das funktioniert auch prima in der Konsole, das Logfile wird angelegt und nachher steht "Hallo Welt!\n" drin.
Aber wenn ich das Skript als gleicher User als Scheduled Task laufen lasse geht es nicht mehr.

Angelegt wurde der Task wie folgt:
Control Panel -> Scheduled Tasks -> Add Scheduled Task

Der User hat alle Rechte auf das Verzeichnis.

Ich bekomme keine Fehlermeldungen.

Und das sagt Perl -v:

This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2000, Larry Wall

Binary build 623 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 16:27:07 Dec 15 2000


So, hoffe das sind jetzt genug Informationen.

Gruss,
Ozymades

View full thread Perl-Skript und Scheduled Tasks: Perl-Skript läuft nicht los...