perl -e ' $value = "12345654321"; @twos = ($value=~ /2/g);print "|", join "|" , @twos,"\n";' #### push @array, $1;