Thread undef aus array löschen
(3 answers)
Opened by Gast at 2007-01-31 14:47
[quote=docsnyder,31.01.2007, 14:07]
Code: (dl
)
1 @arr = ( "", "", "Text 1", undef, "Text 2", undef, "" ); besser: @arr = grep { defined $_ && length $_ } @arr; sonst werden auch eintraege mit einer 0 geloescht. 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: ![]() ![]() |