my @array = qw( you really don't know where the entry is do you ); my $cnt = 0; my %hash = map { $_ => $cnt++ } @array; print $hash{entry}, "\n";