Thread Kommandozeilenparameter übergeben (43 answers)
Opened by franc at 2011-01-17 16:34

FIFO
 2011-01-19 13:40
#144841 #144841
User since
2005-06-01
469 Artikel
BenutzerIn

user image
2011-01-19T09:52:10 bianca
Und was sollte man damit dann anfangen?

Code (perl): (dl )
1
2
3
4
5
6
7
#!/usr/bin/perl -w
use strict;
use warnings;
use constant TRUE => 1;
use constant FALSE => 1;
my $a;
if ($a == TRUE) { print "true\n" }


Edit: Ausgabe:
Code: (dl )
Use of uninitialized value $a in numeric eq (==) at test.pl line 7.


Das ist eigentlich eine philosophische Frage. Du vergleichst hier das Nichts, also die vollkommene Leere (in $a, das btw. eine globale Variable ist: perldoc -f sort) also sogar die Abwesenheit der Null, mit der Wahrheit (TRUE). Das hat was von Zen, aber Perl hält sich da raus und warnt Dich vor Ungereimtheiten ;-)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Kommandozeilenparameter übergeben