I am trying to reset certain pixels of an image which I have read in from a .gif file. This line at best just alters one pixel even though it is called many times with different values for the col and row.
$img_gry->Set('pixel[$col,$row]' => 'rgb($sub_red, $sub_green, $sub_bl
+ue )');
However, if I store all the lines in an array using
$con_str = "\$img_gry->Set('pixel[$col,$row]' => 'rgb($sub_red, $sub_g
+reen, $sub_blue)')";
push(@pix_con_str, $con_str);
and then process these using the following loop which uses eval, all the required changes are made.
for $jc (@pix_con_str) {
eval($jc);
}
I just wondered if anyone knew why this was the case. I can send more of the Perl script if that is of any use).