my @strings; my @messages; #process first 65 strings # loop through the numbers 0 thru 64 inclusive for my $i (0..64) { if(substr($strings[$i][$count],0,2) eq "MY") { $messages[$i] = substr($strings[$i][$count],2); } }