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).

In reply to Pixel setting oddity - Image:Magick by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.