Thread gleiche Werte in hash schnell finden? (9 answers)
Opened by perlensammler22 at 2015-09-11 12:31

GwenDragon
 2015-09-11 13:35
#182160 #182160
User since
2005-01-17
14760 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
my $hash = {
    'Helfer1' => {
        'Mail'       => 'Mail1@adresse',
        'RicDump'    => '0',
        'EnableMail' => '1',
        'EnableTS'   => '0',
        'Kommentar'  => '',
        'HandyTS'    => '+49xxxxxx',
        'RIC'        => '1234560,1234561,8,123462,123453',
    },
    'Helfer3' => {
        'Mail'       => 'Mail3@adresse',
        'RicDump'    => '0',
        'EnableMail' => '1',
        'EnableTS'   => '0',
        'Kommentar'  => '',
        'HandyTS'    => '+49xxxxxx',
        'RIC'        => '1234560,1234561,1234562,1234563,99',
    },
};


my $externeRIC = "99";

my $sendMail = 
  join ",",
  map { $hash->{$_}->{Mail} }
  grep { $externeRIC ~~ [ split /,/, $hash->{$_}->{RIC} ] } 
  keys %$hash;

View full thread gleiche Werte in hash schnell finden?