perl -e ' @foo=('a','b','c', 'd', 'e', 'f', 'g', 'h', 'i'); $str = join("",@foo); $idx = index($str,'g'); print "$str-$idx\n";'