http://www.perlmonks.org?node_id=66731


in reply to Shortest -return index of element in array- sub

this works:
#!perl use strict; sub iA{join('',map{$_ if($_[0]eq$_[$_])}(1..$#_))-1} my(@array) = qw(foo bar crap stuff); print "$_: ".iA($_,@array),"\n" for(qw(foo dolsman crap));
just my two cents :)



lindex
/****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/