Thread Use of uninitialized value ...: Hash mit Array als value (undef)
(14 answers)
Opened by Duff at 2007-07-10 16:56 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #!/usr/bin/perl use strict; use warnings; my %hash = ( '[foo]' => [3], '[bar]' => [2], '[buz]' => [1], '[qiz]' => [undef], ); print 'K: '. $_ .' V: '. $hash{$_}->[0] . "\n" for sort { $hash{$a}->[0] <=> $hash{$b}->[0] } grep { defined $hash{$_}->[0] } keys %hash; |