Thread Hashreferenz auf Gültigkeit prüfen
(9 answers)
Opened by Duff at 2008-08-01 13:58 renee+2008-08-01 12:04:45-- da ist ein grosser teil unnötig. Code (perl): (dl
)
if (ref $hash eq 'HASH' and keys %$hash) { ref() liefert nämlich bei undef oder keiner ref einfach den leeren string. 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: Wie frage ich & perlintro brian's Leitfaden für jedes Perl-Problem |