Thread Index eines bestimmten Array-Elements: index(@array, $array_element) (7 answers)
Opened by pearl-man at 2006-02-09 14:47

Crian
 2006-02-09 15:12
#62786 #62786
User since
2003-08-04
5871 Artikel
ModeratorIn
[Homepage]
user image
Wenn du die Indices mehrfach brauchst:

Code: (dl )
1
2
3
4
5
6
my @array = (qw/eins zwei drei/);
my %index;
my $i = 0;
$index{$_} = $i++ for @array;

print "Index von zwei: ", $index{'zwei'}, "\n";
\n\n

<!--EDIT|Crian|1139490810-->
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread Index eines bestimmten Array-Elements: index(@array, $array_element)