Ok, I can't do a simple s/// because I actually have to rotate them. It's something with the conditional or the assignment. I tried updating the code in this manner
#!/usr/bin/perl

open my $in,  '<:raw', 'out.dat' or die $!;
open my $out, '>:raw', 'outfile.jpg' or die $!;
local $/ = \1024;
my $byte;
while (read($in, $byte, 1)) {
	if($byte == x00){
		$byte = chr(x17);}
	elsif($byte == x17){
		$byte = chr(x00);}
	elsif($byte == x4E){
		$byte = chr(x42);}
	elsif($byte == x42){
		$byte = chr(x4E);}
	elsif($byte == x24){
		$byte = chr(x90);}
	elsif($byte == x90){
		$byte = chr(x24);}
	print $out $byte;
}
close $in or die $!;
close $out or die $!;
all it prints is many nulls and sporadic digits 1..9. I've even tried this with an if($byte eq chr(x00)) but it doesn't work eighther.

In reply to Re^2: Binary conditionals by bunnym4n
in thread Binary conditionals by bunnym4n

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.