Thread Array: doppelte/ähnliche Einträge entfernen? (1 answers)
Opened by x-man at 2005-09-16 22:08

renee
 2005-09-17 18:18
#5615 #5615
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 my %hash = ();
my @array = qw(familie
familie/papa
familie/papa/auto
familie/papa/computer
familie/mama
freunde
freunde/michael
freunde/monique
hobbies/sport
hobbies/sport/fussball);

for my $elem(@array){
my ($root) = split(/\//,$elem);
next if(exists($hash{$root}));
$hash{$root} = $elem;
}

my @unique = values(%hash);

}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Array: doppelte/ähnliche Einträge entfernen?