in reply to substituting values in an array

You have 2 problems: wrong end condition in your for loop and you are trying to substitute from the unassigned $_ variable. No need for s/// ... just assign.
@array = ('200', '201', '205', '194', '140', '250', '280'); print "original\n" , "@array " , "\n"; $count = @array; for ($i = 0; $i < $count; $i++) { if ($array[$i] gt '200') { $array[$i] = 200; } } print "new:\n" , "@array ", "\n";

Tip #2 from the Basic debugging checklist: print