I may be missing something but man perlfunc tells me the binmode command only takes one argument, so what is ":raw" there for? Are you using a module which overrides the binmode function?

Also, why are you using binmode? If you want to view your file in ascii and set position in file binmode does not seem appropriate. The file will be the same on disk whether it is on dos or unix. I would only use binmode if trying to read a line without specifying byte length to read.

Also please check the usage of the read command in Perl. Otherwise the ord function does it in base 10, or see entries for hex and oct in the perl function manual. Here's mine.

open (IN,"$filename") || die "Can't open $filename. $!\n"; read (IN,$buf,$numbytes,$startbyte) || die "Read error. $!\n"; close (IN);

In reply to Re: unicode? conversion by mattr
in thread unicode? conversion by daveh71

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.