Thread Problem mit -w und Perl-Skript als Cron-Job
(5 answers)
Opened by nepos at 2006-08-22 12:40
[quote=nepos,22.08.2006, 11:48]
Code (perl): (dl
)
1 2 warn BOLD, RED, "Verzeichnis \"$INTRANETDIRPDF/$relativePath\" nicht beschreibbar!" unless ( $test ), RESET; was soll denn das für ein konstrukt sein? hier zeigt sich mal wieder, wie wichtig warnings sind. "Useless use of a variable in void context" foo() unless ($x), $y wird zu foo() unless $x, $y; da unless eine bedingung erwartet, wird $x, $y im skalaren kontext ausgewertet und das $x ignoriert. es wird also das $y (bei dir RESET, was immer das auch ist) ausgewertet. Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: ![]() ![]() |