obwohl AoA noch schneller wäre
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
30
31
32
33
34
35
36
37
#!usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use constant {
HOSTNAME => 0,
TIMESTAMP1 => 1,
TIMESTAMP2 => 2,
TEXT => 3,
};
my $set = [];
my $record1 = [
'box',
'200412311931',
'200503190712',
'Hello World!',
# yada yada yada
];
my $record2 = [
'box2',
'200412311931',
'200503190712',
'foo bar baz',
# yada yada yada
];
push @$set, $record1;
push @$set, $record2;
print Dumper $set;
print Dumper grep { $_->[HOSTNAME] eq 'box' } @$set; # filtering records