$> perl -e "\$pos = -1;print (\$pos . ' ') while((\$pos = index('joe,is,at,home', ',', \$pos+1)) != -1);" 3 6 9