#!/usr/bin/perl -w my @foo=('a','b','c', 'd', 'e', 'f', 'g', 'h', 'i'); my %bar; my $i = 0; $bar{$_} = $i++ for (@foo); print ("G's index = $bar{'g'}\n"); __END__ G's index = 6