Thread Use of uninitialized value ...: Hash mit Array als value (undef) (14 answers)
Opened by Duff at 2007-07-10 16:56

Ronnie
 2007-07-11 12:43
#78353 #78353
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
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;

View full thread Use of uninitialized value ...: Hash mit Array als value (undef)