Thread performante Möglichkeit für grössere Datenstruktur (7 answers)
Opened by tbase at 2006-08-20 13:44

esskar
 2006-08-22 09:35
#69051 #69051
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
obwohl AoA noch schneller wäre

Code: (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
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

View full thread performante Möglichkeit für grössere Datenstruktur