Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Friday November 28, 2003
10:12 AM

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

[ #16059 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • > 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.