<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font face="Helvetica, Arial, sans-serif">Adding to what Matt just
      said, once you've handled the issues he just explained, you'll be
      needing sysopen(), sysseek(), sysread(), and syswrite().  Regular
      Perl IO won't work for you.<br>
      <br>
      For image operations, I usually use the tried and true GD.pm<br>
      <br>
      Without understanding your reasons for eschewing the use of
      modules in your work on this particular project (while respecting
      your reasons all the same), I'd like to just make some generalized
      points that a surprising many Perl users sadly do not know. 
      Please don't take it as an insult if you already know these
      things, as I make the following statements for the benefit of the
      group as a whole:<br>
      <br>
      While using modules is sometimes not an option-- for example you
      may be working on something in a company with servers where you're
      not allowed to install things-- it's no sign of weakness to take
      advantage of everything Perl has to offer and try out a module. 
      Using the CPAN is a hallmark of a strong Perl programmer, in the
      general opinion of the Perl community over the years.  The
      graphics modules we've discussed are written in C and are very
      fast.  You incur near zero penalty for using such libraries, which
      are also optimized to work faster and more efficiently at their
      specific tasks than what you'd be doing on your own.  Unless you
      have a very compelling reason to do otherwise, Perl and its
      community always recommend not to reinvent the wheel when the
      option is on the table to use its (very) nice CPAN wheels for
      free.  If it's a learning experience you seek, it's also of
      benefit to look at the source code of these CPAN modules so you
      can see how others are doing what you'd like to do on your own.  I
      always start looking at <a class="moz-txt-link-freetext" href="http://search.cpan.org">http://search.cpan.org</a><br>
      <br>
      Hope to see you at the meeting tomorrow night!<br>
      <br>
      --Tommy Butler<br>
      <br>
      On 01/08/2013 04:31 PM, Matthew Musgrove wrote:</font>
    <blockquote
cite="mid:CAJaTdr2OOLufqCsu7h0nnfU1Nu_pibXASe0MMBKqRfhGOR0GkA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <p class=""><font face="Helvetica, Arial, sans-serif"><span
              style="font-size: 11pt; font-family:
              "Calibri","sans-serif"; color: rgb(31,
              73, 125);">Jerry,</span></font></p>
        <p class=""><font face="Helvetica, Arial, sans-serif"><span
              style="font-size: 11pt; font-family:
              "Calibri","sans-serif"; color: rgb(31,
              73, 125);">You can’t just change a few bytes in an image
              file and be done
              with it.  If you don’t want to use a module, then you’ll
              need to be well
              versed in the various image file formats before you can
              ever start coding.
              Otherwise you won’t know what bits to look for, much less
              what values to use to
              get the change you are interested in. </span></font></p>
        <p class=""><font face="Helvetica, Arial, sans-serif"><span
              style="font-size: 11pt; font-family:
              "Calibri","sans-serif"; color: rgb(31,
              73, 125);"> </span></font></p>
        <p class=""><font face="Helvetica, Arial, sans-serif"><span
              style="font-size: 11pt; font-family:
              "Calibri","sans-serif"; color: rgb(31,
              73, 125);">Matt</span></font></p>
      </div>
      <div class="gmail_extra"><font face="Helvetica, Arial, sans-serif"><br>
          <br>
        </font>
        <div class="gmail_quote"><font face="Helvetica, Arial,
            sans-serif">On Tue, Jan 8, 2013 at 4:16 PM, Jerry Kassebaum
            <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:kassebaumj@hotmail.com" target="_blank">kassebaumj@hotmail.com</a>></span>
            wrote:<br>
          </font>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div>
              <div dir="ltr">
                <div>
                  <div><font face="Helvetica, Arial, sans-serif">How can
                      I use Perl to read a non-text file in hex, change
                      a few individual bytes, and write it back? Would
                      this work to change a gif or png, or would I have
                      to go down to binary?<br>
                      <br>
                      I appreciate the ImageMagic answer I received
                      before, and may have to resort to that, but I
                      would prefer to work with pure Perl without
                      loading a module. Surely there is a simple way to
                      read/write a file byte by byte?<span
                        class="HOEnZb"><font color="#888888"><br>
                          <div>
                            <p><span style="font-size: 10pt;
                                font-family:
                                "Tahoma","sans-serif";">
                                <br>
                                Jerry Kassebaum</span><font
                                face="Helvetica, Arial, sans-serif"><br>
                              </font></p>
                          </div>
                        </font></span></font></div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
  </body>
</html>