DB<1> @input=('a','b','c','d'); DB<2> %pos= map { $_=>$i++ } @input DB<3> print $pos{a} 0 DB<4> print $pos{d} 3