Thread Problem mit -w und Perl-Skript als Cron-Job (5 answers)
Opened by nepos at 2006-08-22 12:40

pq
 2006-08-22 14:51
#69081 #69081
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=nepos,22.08.2006, 11:48]
Code (perl): (dl )
1
2
      warn BOLD, RED, "Verzeichnis \"$INTRANETDIRPDF/$relativePath\" nicht beschreibbar!"
        unless ( $test ), RESET;
[/quote]
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: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Problem mit -w und Perl-Skript als Cron-Job