Re: store index numbers of all array1 elements in array2 which equalkeys in a hash

2001-09-22 Thread Michael Fowler
On Sat, Sep 22, 2001 at 03:27:01AM +0200, birgit kellner wrote: > --On Samstag, 22. September 2001 01:09 +0200 Andrea Holstein > > Simple solution is > > ... > > my $index = 0; > > foreach my $element (@array) { > > if (...) { > > ... > > } > > $index++; > > } > > > Thank

Re: store index numbers of all array1 elements in array2 which equalkeys in a hash

2001-09-21 Thread Andrea Holstein
Birgit Kellner wrote: > > my %hash = ('firstkey' => 'firstvalue', > 'secondkey' => 'secondvalue', > 'thirdkey' => 'thirdvalue'); > my @array = ('secondkey', 'other element', 'still other element', > 'firstkey'); > my @index_array; > foreach my $element (@array) { > # QUEST

store index numbers of all array1 elements in array2 which equalkeys in a hash

2001-09-21 Thread birgit kellner
my %hash = ('firstkey' => 'firstvalue', 'secondkey' => 'secondvalue', 'thirdkey' => 'thirdvalue'); my @array = ('secondkey', 'other element', 'still other element', 'firstkey'); my @index_array; foreach my $element (@array) { # QUESTION: here I'd like to have some code tha