<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Perl reads and writes non-text files.  To deal with this data in hex look at pack and unpack.</span></div><div><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Jerry Kassebaum <kassebaumj@hotmail.com><br> <b><span style="font-weight: bold;">To:</span></b> dfw-pm@pm.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, January 8, 2013 4:16 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [DFW.pm] Changing colors in a gif using cgi<br> </font> </div> <br>
<div id="yiv803806833">

<style><!--
#yiv803806833 .yiv803806833hmmessage P
{
margin:0px;padding:0px;}
#yiv803806833 body.yiv803806833hmmessage
{
font-size:10pt;font-family:Tahoma;}
--></style>
<div><div dir="ltr">
<div><div class="yiv803806833ecxWordSection1">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?<br><div><div class="yiv803806833ecxMsoNormal"><span style="font-size:10.0pt;">
<br>
Jerry Kassebaum</span></div>
</div>
</div>


<br></div>                                    </div></div>
</div><br>_______________________________________________<br>Dfw-pm mailing list<br><a ymailto="mailto:Dfw-pm@pm.org" href="mailto:Dfw-pm@pm.org">Dfw-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/dfw-pm" target="_blank">http://mail.pm.org/mailman/listinfo/dfw-pm</a><br><br><br> </div> </div>  </div></body></html>