The first thing I notice is that he says 0x20 (space) through 0x7E (tilde). but the code has /^\t\040-\176/.

Those are identical ranges, one in hexadeximal, and the other in octal. (He does also allow \t tabs as space, though.)

printf("%d %d %d \n", 040, 32, 0x20); printf("%d %d %d \n", 0176, 126, 0x7E);

A leading zero (040) means the number is read as octal.
A leading zero-ecks (0x20) means the number is read as hexadecimal.

I'm of the opinion that computer-gradeschoolers should learn some very clear "landmark" numbers to help them understand different codebases. (I also plan to teach my daughter to memorize sixteen powers of two in decimal before she leaves the fourth grade. Inchworm, inchworm, measuring the merigolds...)

binary 00001001 = 011 = 9 = 0x9 = nine
binary 00001100 = 014 = 12 = 0xC = a dozen
binary 00111111 = 077 = 63 = 0x3F = six bits full (8x8-1)
binary 01111111 = 0177 = 127 = 0x7F = seven bits full (16x8-1)
binary 11111111 = 0377 = 255 = 0xFF = eight bits full (16x16-1)
binary 1111111111111111 = 0177777 = 65535 = 0xFFFF = sixteen bits full (256x256-1)

--
[ e d @ h a l l e y . c c ]


In reply to Re: Altering Text::CSV to handle Unicode data by halley
in thread Altering Text::CSV to handle Unicode data by princepawn

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.