Thread Array Prüfung (4 answers)
Opened by jan10001 at 2003-10-13 18:59

pq
 2003-10-13 20:26
#62858 #62858
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=DS,13.10.2003, 18:15]Ich hab noch nie getestet, was passiert, wenn man einen Array mit defined testet, also hab' ich das mal nachgeholt...[/quote]
aus perldoc -f defined:
              Use of "defined" on aggregates (hashes and arrays)
              is deprecated.  It used to report whether memory
              for that aggregate has ever been allocated.  This
              behavior may disappear in future versions of Perl.
              You should instead use a simple test for size:

                  if (@an_array) { print "has array elements\n" }
                  if (%a_hash)   { print "has hash members\n"   }
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 Array Prüfung