To expand a bit on NetWallah's remarks, if you are using 5.8.0, and have a locale-aware environment that happens to be set currently to "utf-8", then perl will try to interpret non-ASCII data as if it were utf-8 data by default, and you'd need to expressly tell it not to do that, via the "use bytes" and/or "no utf8" pragmas (or by changing your locale setting). See the "perluniintro" and "perlunicode" man pages if this applies to you.

You say you are not really doing any utf8 stuff, but it would appear that your text file contains non-ASCII data (e.g. latin1 "accented" characters). If the file uses the "upper table" of iso-8859-1, then the "0xb2" byte is a superscript "2". If it's some other character set, then it's probably some other "special" character. Or maybe it's just noisy data...

In any case, upgrading to 5.8.2 (the current version) will help. 5.8.0's "interpretive preference" based on the locale setting was ultimately viewed as a bad idea, and was changed in 5.8.1.


In reply to Re: Regex (find an * after a digit) by graff
in thread Regex (find an * after a digit) by Anonymous Monk

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.