Rush^H^H^H^Hbrian is a big, fat idiot

brian_d_foy on 2003-11-28T15:12:04

Come on stupid head, pick a representation and stay with it:

if( $hex == 0x15 or $hex == 0x12 ) { print "\n"; next BYTE }


For those of you who do not see it (like I did not for several minutes), I want to print a newline if the thing in hex is the ASCII code for a newline or carriage return. Those values in decimal are 15 and 12, and in hex 0x0D and 0x0A. Well, I invited everyone to the party and no one got to the keg. The values 0x15 and 0x12 are unprintables, not whitespace.


hexed

jhi on 2003-11-28T15:56:02

> if( $hex == 0x15 or $hex == 0x12 ) { print "\n"; next BYTE }

Probably not helped by the fact that the hex() function of Perl is more like "unhex()", really... (the %x of printf being the "real hex()"). At least that is how my brain works.